summaryrefslogtreecommitdiff
path: root/builtin/pack-objects.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2023-04-25 13:56:20 -0700
committerJunio C Hamano <gitster@pobox.com>2023-04-25 13:56:20 -0700
commit36628c56ed54b5a86aa9a17ed589fc0ee7f5bea5 (patch)
tree3fadafc81f95d070092fb0a000b10dc02f5b1669 /builtin/pack-objects.c
parentc4c9d5586fed1b994ef579a0862b86ff36afcbe8 (diff)
parentd85cd1877777aa92c73868b9e86516d4be04b4a0 (diff)
downloadgit-36628c56ed54b5a86aa9a17ed589fc0ee7f5bea5.tar.gz
Merge branch 'ps/fix-geom-repack-with-alternates'
Geometric repacking ("git repack --geometric=<n>") in a repository that borrows from an alternate object database had various corner case bugs, which have been corrected. * ps/fix-geom-repack-with-alternates: repack: disable writing bitmaps when doing a local repack repack: honor `-l` when calculating pack geometry t/helper: allow chmtime to print verbosely without modifying mtime pack-objects: extend test coverage of `--stdin-packs` with alternates pack-objects: fix error when same packfile is included and excluded pack-objects: fix error when packing same pack twice pack-objects: split out `--stdin-packs` tests into separate file repack: fix generating multi-pack-index with only non-local packs repack: fix trying to use preferred pack in alternates midx: fix segfault with no packs and invalid preferred pack
Diffstat (limited to 'builtin/pack-objects.c')
-rw-r--r--builtin/pack-objects.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index 9297a077f8..bbba1af27b 100644
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
@@ -3360,16 +3360,16 @@ static void read_packs_list_from_stdin(void)
}
string_list_sort(&include_packs);
+ string_list_remove_duplicates(&include_packs, 0);
string_list_sort(&exclude_packs);
+ string_list_remove_duplicates(&exclude_packs, 0);
for (p = get_all_packs(the_repository); p; p = p->next) {
const char *pack_name = pack_basename(p);
- item = string_list_lookup(&include_packs, pack_name);
- if (!item)
- item = string_list_lookup(&exclude_packs, pack_name);
-
- if (item)
+ if ((item = string_list_lookup(&include_packs, pack_name)))
+ item->util = p;
+ if ((item = string_list_lookup(&exclude_packs, pack_name)))
item->util = p;
}