Skip to content

Commit f116039

Browse files
derrickstoleegitster
authored andcommitted
commit-graph: increment progress indicator
This fixes a bug that was introduced by 368d19b (commit-graph: refactor compute_topological_levels(), 2023-03-20): Previously, the progress indicator was updated from `i + 1` where `i` is the loop variable of the enclosing `for` loop. After this patch, the update used `info->progress_cnt + 1` instead, however, unlike `i`, the `progress_cnt` attribute was not incremented. Let's increment it. Signed-off-by: Derrick Stolee <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]> [jc: squashed in a test update from Patrick Steinhardt] Signed-off-by: Junio C Hamano <[email protected]>
1 parent cbfe360 commit f116039

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

commit-graph.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1487,7 +1487,7 @@ static void compute_reachable_generation_numbers(
14871487
timestamp_t gen;
14881488
repo_parse_commit(info->r, c);
14891489
gen = info->get_generation(c, info->data);
1490-
display_progress(info->progress, info->progress_cnt + 1);
1490+
display_progress(info->progress, ++info->progress_cnt);
14911491

14921492
if (gen != GENERATION_NUMBER_ZERO && gen != GENERATION_NUMBER_INFINITY)
14931493
continue;

t/t6500-gc.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ test_expect_success TTY 'with TTY: gc --no-quiet' '
174174
git -c gc.writeCommitGraph=true gc --no-quiet >stdout 2>stderr &&
175175
test_must_be_empty stdout &&
176176
test_i18ngrep "Enumerating objects" stderr &&
177-
test_i18ngrep "Computing commit graph generation numbers" stderr
177+
test_i18ngrep "Computing commit graph generation numbers: 100% (4/4), done." stderr
178178
'
179179

180180
test_expect_success 'gc --quiet' '

0 commit comments

Comments
 (0)