Skip to content

Commit 833f4c0

Browse files
peffgitster
authored andcommitted
pack-bitmap.c: break out of the bitmap loop early if not tracing
After opening a bitmap successfully, we try opening others only because we want to report that other bitmap files are ignored in the trace2 log. When trace2 is not enabled, we do not have to do any of that. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Teng Long <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 8ddc066 commit 833f4c0

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

pack-bitmap.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,8 +527,15 @@ static int open_pack_bitmap(struct repository *r,
527527
assert(!bitmap_git->map);
528528

529529
for (p = get_all_packs(r); p; p = p->next) {
530-
if (open_pack_bitmap_1(bitmap_git, p) == 0)
530+
if (open_pack_bitmap_1(bitmap_git, p) == 0) {
531531
ret = 0;
532+
/*
533+
* The only reason to keep looking is to report
534+
* duplicates.
535+
*/
536+
if (!trace2_is_enabled())
537+
break;
538+
}
532539
}
533540

534541
return ret;

0 commit comments

Comments
 (0)