[PATCH v3 2/6] receive-pack: avoid repeating connectivity errors
From: Elijah Newren via GitGitGadget <hidden>
Date: 2026-09-06 07:25:06
Subsystem:
the rest · Maintainer:
Linus Torvalds
From: Elijah Newren <redacted> receive-pack first checks all proposed ref tips together. If that bulk connectivity check fails, it checks each tip separately to identify which ref updates need "missing necessary objects". The bulk check already reports rev-list's diagnostic. The per-ref checks repeat it merely as a side effect of attributing the failure, potentially once for every broken ref. Silence their stderr while retaining their exit status and the per-ref rejection. Signed-off-by: Elijah Newren <redacted> --- builtin/receive-pack.c | 7 +++++++ t/t5410-receive-pack.sh | 6 ++++-- 2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
index e6e54ba55f..8079901bb6 100644
--- a/builtin/receive-pack.c
+++ b/builtin/receive-pack.c@@ -1785,6 +1785,13 @@ static void set_connectivity_errors(struct command *commands, /* to be checked in update_shallow_ref() */ continue; + /* + * The bulk check already reported rev-list's diagnostics; + * this per-ref pass only attributes the failure, so keep it + * quiet rather than repeat those errors for every ref. + */ + opt.quiet = 1; + odb_transaction_env(transaction, &env); opt.env = env.v;
diff --git a/t/t5410-receive-pack.sh b/t/t5410-receive-pack.sh
index 09d6bfd2a1..20d221044f 100755
--- a/t/t5410-receive-pack.sh
+++ b/t/t5410-receive-pack.sh@@ -68,9 +68,11 @@ test_expect_success TEE_DOES_NOT_HANG \ # Replay captured git-send-pack(1) output on new empty repository. git init --bare remote.git && git receive-pack remote.git <out >actual 2>err && + depacketize <actual >actual.raw && - test_grep "missing necessary objects" actual && - test_grep "fatal: Failed to traverse parents" err && + test_grep "missing necessary objects" actual.raw && + test_grep "fatal: Failed to traverse parents" actual.raw && + test_must_be_empty err && test_must_fail git -C remote.git cat-file -e $(git -C repo rev-parse HEAD) '
--
gitgitgadget