static int ensure_valid_ownership(const char *gitfile,
				const char *worktree, const char *gitdir)
{
	struct safe_directory_data data = {
		.path = worktree ? worktree : gitdir
	};

	if (!git_env_bool("GIT_TEST_ASSUME_DIFFERENT_OWNER", 0) &&
	   (!gitfile || is_path_owned_by_current_user(gitfile)) &&
	   (!worktree || is_path_owned_by_current_user(worktree)) &&
	   (!gitdir || is_path_owned_by_current_user(gitdir)))
		return 1;

	/*
	 * data.path is the "path" that identifies the repository and it is
	 * constant regardless of what failed above. data.is_safe should be
	 * initialized to false, and might be changed by the callback.
	 */
	read_very_early_config(safe_directory_cb, &data);

	return data.is_safe;
}
static int ensure_valid_ownership(const char *gitfile,
				const char *worktree, const char *gitdir)
{
	struct safe_directory_data data = {
		.path = worktree ? worktree : gitdir
	};

	if (!git_env_bool("GIT_TEST_ASSUME_DIFFERENT_OWNER", 0) &&
	   (!gitfile || is_path_owned_by_current_user(gitfile)) &&
	   (!worktree || is_path_owned_by_current_user(worktree)) &&
	   (!gitdir || is_path_owned_by_current_user(gitdir)))
		return 1;

	 
	read_very_early_config(safe_directory_cb, &data);

	return data.is_safe;
}