From: Junio C Hamano Date: Thu, 8 Jan 2026 07:40:37 +0000 (+0900) Subject: Merge branch 'jk/cat-file-avoid-bitmap-when-unneeded' into jch X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b17d88edb1c242c94f9d3e0be0d229a827228efc;p=thirdparty%2Fgit.git Merge branch 'jk/cat-file-avoid-bitmap-when-unneeded' into jch Fix for a performance regression in "git cat-file". * jk/cat-file-avoid-bitmap-when-unneeded: cat-file: only use bitmaps when filtering --- b17d88edb1c242c94f9d3e0be0d229a827228efc diff --cc builtin/cat-file.c index 2ad712e9f8,6d704ec6c9..df8e87a81f --- a/builtin/cat-file.c +++ b/builtin/cat-file.c @@@ -845,15 -839,17 +845,17 @@@ static void batch_each_object(struct ba .callback = callback, .payload = _payload, }; - struct bitmap_index *bitmap = prepare_bitmap_git(the_repository); + struct bitmap_index *bitmap = NULL; - for_each_loose_object(batch_one_object_loose, &payload, 0); + for_each_loose_object(the_repository->objects, batch_one_object_loose, &payload, 0); - if (bitmap && !for_each_bitmapped_object(bitmap, &opt->objects_filter, - batch_one_object_bitmapped, &payload)) { + if (opt->objects_filter.choice != LOFC_DISABLED && + (bitmap = prepare_bitmap_git(the_repository)) && + !for_each_bitmapped_object(bitmap, &opt->objects_filter, + batch_one_object_bitmapped, &payload)) { struct packed_git *pack; - for (pack = get_all_packs(the_repository); pack; pack = pack->next) { + repo_for_each_pack(the_repository, pack) { if (bitmap_index_contains_pack(bitmap, pack) || open_pack_index(pack)) continue;