Skip to content

Commit 6f9d5f2

Browse files
szedergitster
authored andcommitted
commit-graph: fix progress of reachable commits
To display a progress line while iterating over all refs, d335ce8 (commit-graph.c: show progress of finding reachable commits, 2020-05-13) should have added a pair of start_delayed_progress() and stop_progress() calls around a for_each_ref() invocation. Alas, the stop_progress() call ended up at the wrong place, after write_commit_graph(), which does all the commit-graph computation and writing, and has several progress lines of its own. Consequently, that new Collecting referenced commits: 123 progress line is overwritten by the first progress line shown by write_commit_graph(), and its final "done" line is shown last, after everything is finished: Expanding reachable commits in commit graph: 344786, done. Computing commit changed paths Bloom filters: 100% (344786/344786), done. Collecting referenced commits: 154, done. Move that stop_progress() call to the right place. While at it, drop the unnecessary 'if (data.progress)' condition protecting the stop_progress() call, because that function is prepared to handle a NULL progress struct. Signed-off-by: SZEDER Gábor <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 2f00c35 commit 6f9d5f2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

commit-graph.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1354,12 +1354,13 @@ int write_commit_graph_reachable(struct object_directory *odb,
13541354
_("Collecting referenced commits"), 0);
13551355

13561356
for_each_ref(add_ref_to_set, &data);
1357+
1358+
stop_progress(&data.progress);
1359+
13571360
result = write_commit_graph(odb, NULL, &commits,
13581361
flags, split_opts);
13591362

13601363
oidset_clear(&commits);
1361-
if (data.progress)
1362-
stop_progress(&data.progress);
13631364
return result;
13641365
}
13651366

0 commit comments

Comments
 (0)