]> git.ipfire.org Git - thirdparty/git.git/commitdiff
commit-graph: increment progress indicator
authorDerrick Stolee <derrickstolee@github.com>
Tue, 11 Jun 2024 15:09:15 +0000 (15:09 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 12 Jun 2024 20:52:14 +0000 (13:52 -0700)
This fixes a bug that was introduced by 368d19b0b7 (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 <derrickstolee@github.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
[jc: squashed in a test update from Patrick Steinhardt]
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit-graph.c
t/t6500-gc.sh

index 172e679db1977f64b5bf2253a4a3ec7dc21b9dd8..3c5a2010be97e17d21b0e9313f30cb0f54a48fe9 100644 (file)
@@ -1487,7 +1487,7 @@ static void compute_reachable_generation_numbers(
                timestamp_t gen;
                repo_parse_commit(info->r, c);
                gen = info->get_generation(c, info->data);
-               display_progress(info->progress, info->progress_cnt + 1);
+               display_progress(info->progress, ++info->progress_cnt);
 
                if (gen != GENERATION_NUMBER_ZERO && gen != GENERATION_NUMBER_INFINITY)
                        continue;
index d9acb639512ae6bdf30c8bdd4a0b4d498541dd84..a85f6d685c144c250d95d84e3e01fb9f509d5bd1 100755 (executable)
@@ -174,7 +174,7 @@ test_expect_success TTY 'with TTY: gc --no-quiet' '
                git -c gc.writeCommitGraph=true gc --no-quiet >stdout 2>stderr &&
        test_must_be_empty stdout &&
        test_i18ngrep "Enumerating objects" stderr &&
-       test_i18ngrep "Computing commit graph generation numbers" stderr
+       test_i18ngrep "Computing commit graph generation numbers: 100% (4/4), done." stderr
 '
 
 test_expect_success 'gc --quiet' '