git-2.22.0/commit-graph.c
/*
 * Return 1 if commit_graph is non-NULL, and 0 otherwise.
 *
 * On the first invocation, this function attemps to load the commit
 * graph if the_repository is configured to have one.
 */
Return 1 if commit_graph is non-NULL, and 0 otherwise.
On the first invocation, this function attemps to load the commit
graph if the_repository is configured to have one.
Return 1 if commit_graph is non - NULL and 0 otherwise . On the first invocation this function attemps to load the commit graph if the_repository is configured to have one .
static int prepare_commit_graph(struct repository *r)
{
	struct object_directory *odb;
	int config_value;
	if (git_env_bool(GIT_TEST_COMMIT_GRAPH_DIE_ON_LOAD, 0))
		die("dying as requested by the '%s' variable on commit-graph load!",
		    GIT_TEST_COMMIT_GRAPH_DIE_ON_LOAD);
	if (r->objects->commit_graph_attempted)
		return !!r->objects->commit_graph;
	r->objects->commit_graph_attempted = 1;
	if (!git_env_bool(GIT_TEST_COMMIT_GRAPH, 0) &&
	    (repo_config_get_bool(r, "core.commitgraph", &config_value) ||
	    !config_value))
		return 0;
	if (!commit_graph_compatible(r))
		return 0;
	prepare_alt_odb(r);
	for (odb = r->objects->odb;
	     !r->objects->commit_graph && odb;
	     odb = odb->next)
		prepare_commit_graph_one(r, odb->path);
	return !!r->objects->commit_graph;
}
static int prepare_commit_graph ( struct repository * r ) { struct object_directory * odb ; int config_value ; if ( git_env_bool ( GIT_TEST_COMMIT_GRAPH_DIE_ON_LOAD , 0 ) ) die ( " " , GIT_TEST_COMMIT_GRAPH_DIE_ON_LOAD ) ; if ( r -> objects -> commit_graph_attempted ) return ! ! r -> objects -> commit_graph ; r -> objects -> commit_graph_attempted = 1 ; if ( ! git_env_bool ( GIT_TEST_COMMIT_GRAPH , 0 ) && ( repo_config_get_bool ( r , " " , & config_value ) || ! config_value ) ) return 0 ; if ( ! commit_graph_compatible ( r ) ) return 0 ; prepare_alt_odb ( r ) ; for ( odb = r -> objects -> odb ; ! r -> objects -> commit_graph && odb ; odb = odb -> next ) prepare_commit_graph_one ( r , odb -> path ) ; return ! ! r -> objects -> commit_graph ; }
Return 1 if commit_graph is non-NULL, and 0 otherwise.
Return 1 if commit_graph is non - NULL and 0 otherwise .
/*
		 * This repository is not configured to use commit graphs, so
		 * do not load one. (But report commit_graph_attempted anyway
		 * so that commit graph loading is not attempted again for this
		 * repository.)
		 */