pack-bitmap-write.c: don't return without stop_progress()

Fix a bug that's been here since 7cc8f971085 (pack-objects: implement bitmap writing, 2013-12-21), we did not call stop_progress() if we reached the early exit in this function. We could call stop_progress() before we return, but better yet is to defer calling start_progress() until we need it. For now this only matters in practice because we'd previously omit the "region_leave" for the progress trace2 event. Suggested-by: SZEDER Gábor <szeder.dev@gmail.com> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Ævar Arnfjörð Bjarmason committed Feb 3, 2022 at 22:40 UTC b3118a56f99ca0ec872b84dc760a0dc778f3890e
1 file changed +3 -3
pack-bitmap-write.c
+3 -3
@@ -544,15 +544,15 @@ void bitmap_writer_select_commits(struct commit **indexed_commits,
544
545 QSORT(indexed_commits, indexed_commits_nr, date_compare);
546
547 - if (writer.show_progress)
548 - writer.progress = start_progress("Selecting bitmap commits", 0);
549 -
547 if (indexed_commits_nr < 100) {
548 for (i = 0; i < indexed_commits_nr; ++i)
549 push_bitmapped_commit(indexed_commits[i]);
550 return;
551 }
552
553 + if (writer.show_progress)
554 + writer.progress = start_progress("Selecting bitmap commits", 0);
555 +
556 for (;;) {
557 struct commit *chosen = NULL;
558