summaryrefslogtreecommitdiff
path: root/builtin/pack-objects.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2026-01-21 16:16:27 -0800
committerJunio C Hamano <gitster@pobox.com>2026-01-21 16:16:27 -0800
commit070fa416755497ce78e09713ef5cd37e2c7205f2 (patch)
tree9501aa627d5239ab3bd11c38a042aa7c354ffd26 /builtin/pack-objects.c
parent83a69f19359e6d9bc980563caca38b2b5729808c (diff)
parentdcc9c7ef47d8755f1448116cdf0a421129999cd4 (diff)
downloadgit-070fa416755497ce78e09713ef5cd37e2c7205f2.tar.xz
Merge branch 'ps/geometric-repacking-with-promisor-remotes'
"git repack --geometric" did not work with promisor packs, which has been corrected. * ps/geometric-repacking-with-promisor-remotes: builtin/repack: handle promisor packs with geometric repacking repack-promisor: extract function to remove redundant packs repack-promisor: extract function to finalize repacking repack-geometry: extract function to compute repacking split builtin/pack-objects: exclude promisor objects with "--stdin-packs"
Diffstat (limited to 'builtin/pack-objects.c')
-rw-r--r--builtin/pack-objects.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index 6ee31d48c9..5846b6a293 100644
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
@@ -3863,8 +3863,11 @@ static void read_packs_list_from_stdin(struct rev_info *revs)
repo_for_each_pack(the_repository, p) {
const char *pack_name = pack_basename(p);
- if ((item = string_list_lookup(&include_packs, pack_name)))
+ if ((item = string_list_lookup(&include_packs, pack_name))) {
+ if (exclude_promisor_objects && p->pack_promisor)
+ die(_("packfile %s is a promisor but --exclude-promisor-objects was given"), p->pack_name);
item->util = p;
+ }
if ((item = string_list_lookup(&exclude_packs, pack_name)))
item->util = p;
}
@@ -3942,6 +3945,7 @@ static void read_stdin_packs(enum stdin_packs_mode mode, int rev_list_unpacked)
revs.tree_objects = 1;
revs.tag_objects = 1;
revs.ignore_missing_links = 1;
+ revs.exclude_promisor_objects = exclude_promisor_objects;
/* avoids adding objects in excluded packs */
ignore_packed_keep_in_core = 1;
@@ -5098,9 +5102,13 @@ int cmd_pack_objects(int argc,
exclude_promisor_objects_best_effort,
"--exclude-promisor-objects-best-effort");
if (exclude_promisor_objects) {
- use_internal_rev_list = 1;
fetch_if_missing = 0;
- strvec_push(&rp, "--exclude-promisor-objects");
+
+ /* --stdin-packs handles promisor objects separately. */
+ if (!stdin_packs) {
+ use_internal_rev_list = 1;
+ strvec_push(&rp, "--exclude-promisor-objects");
+ }
} else if (exclude_promisor_objects_best_effort) {
use_internal_rev_list = 1;
fetch_if_missing = 0;