Subject: Re: [PATCH 0/6] odb: track commit graphs via object source

From: Junio C Hamano <[email-masked]>
Date: Thu, 04 Sep 2025 16:27:41 -0700

Patrick Steinhardt <[email-masked]> writes:

> There's a trivial conflict with tc/last-modified that can be solved like
> this:
>
> diff --cc commit-graph.c
> index 9929c1ed87,2f20f66cfd..0000000000
> --- a/commit-graph.c
> +++ b/commit-graph.c
> @@@ -823,7 -812,12 +823,11 @@@ int corrected_commit_dates_enabled(stru
>   
>   struct bloom_filter_settings *get_bloom_filter_settings(struct repository *r)
>   {
>  -	struct commit_graph *g;
>  +	struct commit_graph *g = prepare_commit_graph(r);
> + 
>  -	if (!prepare_commit_graph(r))
> ++	if (!g)
> + 	       return NULL;
> + 

The while (g) loop will be entirely skipped when g==NULL, and then
the function returns NULL after iterating the loop, so there is not
much reason to have these three lines for early-return, no?

>  -	g = r->objects->commit_graph;
>   	while (g) {
>   		if (g->bloom_filter_settings)
>   			return g->bloom_filter_settings;

Thanks.