aboutsummaryrefslogtreecommitdiff
path: root/builtin/pack-objects.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2026-02-25 11:54:17 -0800
committerJunio C Hamano <gitster@pobox.com>2026-02-25 11:54:18 -0800
commitb1f4b5888b473bc2f8412ed4477a47c3b06fb3a5 (patch)
treee9c7ab509b5aa17cdf8ba56e350a1adf3a5dbac9 /builtin/pack-objects.c
parentd21437a91623e3ff63f4620e486eef7088103d73 (diff)
parentf4eff7116dabac7e4f5a6aad8a74feaebdcb8342 (diff)
downloadgit-b1f4b5888b473bc2f8412ed4477a47c3b06fb3a5.tar.xz
Merge branch 'ps/pack-concat-wo-backfill'
"git pack-objects --stdin-packs" with "--exclude-promisor-objects" fetched objects that are promised, which was not wanted. This has been fixed. * ps/pack-concat-wo-backfill: builtin/pack-objects: don't fetch objects when merging packs
Diffstat (limited to 'builtin/pack-objects.c')
-rw-r--r--builtin/pack-objects.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index e6c8f896ab..cfb03d4c09 100644
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
@@ -3924,8 +3924,16 @@ static void add_unreachable_loose_objects(struct rev_info *revs);
static void read_stdin_packs(enum stdin_packs_mode mode, int rev_list_unpacked)
{
+ int prev_fetch_if_missing = fetch_if_missing;
struct rev_info revs;
+ /*
+ * The revision walk may hit objects that are promised, only. As the
+ * walk is best-effort though we don't want to perform backfill fetches
+ * for them.
+ */
+ fetch_if_missing = 0;
+
repo_init_revisions(the_repository, &revs, NULL);
/*
* Use a revision walk to fill in the namehash of objects in the include
@@ -3961,6 +3969,8 @@ static void read_stdin_packs(enum stdin_packs_mode mode, int rev_list_unpacked)
stdin_packs_found_nr);
trace2_data_intmax("pack-objects", the_repository, "stdin_packs_hints",
stdin_packs_hints_nr);
+
+ fetch_if_missing = prev_fetch_if_missing;
}
static void add_cruft_object_entry(const struct object_id *oid, enum object_type type,