🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.git
Article #212

[PATCH 09/15] t5408: check refspec order with distinct destinations

#212
From: Jon Simons
Date: Fri, 09 Oct 2026 19:29
61 lines
7308 bytes
26be19ba8d (send-pack: take refspecs over stdin, 2014-08-21) added tests
to assert that send-pack sends command-line refspecs in the order given,
and those read with --stdin after them, by pushing to the same
destination twice, and seeing which update succeeded.

But since 9d2962a7c4 (receive-pack: use batched reference updates,
2025-05-19) such pushes to the same destination now fail completely on
the server-side with "multiple updates for ref '<dst>' not allowed",
and so the ordering is no longer being asserted.

Add two explicit tests to reinstate the ordering assertions.

Signed-off-by: Jon Simons <jon@jonsimons.org>
---
 t/t5408-send-pack-stdin.sh | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/t/t5408-send-pack-stdin.sh b/t/t5408-send-pack-stdin.sh
index 3c47be1af8..7af350f01c 100755
--- a/t/t5408-send-pack-stdin.sh
+++ b/t/t5408-send-pack-stdin.sh
@@ -67,6 +67,36 @@ test_expect_success 'stdin mixed with cmdline' '
 	verify_push B
 '
 
+test_expect_success 'cmdline refs are sent in order' '
+	clear_remote &&
+	test_hook -C remote.git pre-receive <<-\EOF &&
+	cut -d" " -f3 >pushed-refs
+	EOF
+	git send-pack remote.git A:foo B:bar C:baz &&
+	cat >expect <<-\EOF &&
+	refs/heads/foo
+	refs/heads/bar
+	refs/heads/baz
+	EOF
+	test_cmp expect remote.git/pushed-refs
+'
+
+test_expect_success '--stdin refs are sent after cmdline refs' '
+	clear_remote &&
+	test_hook -C remote.git pre-receive <<-\EOF &&
+	cut -d" " -f3 >pushed-refs
+	EOF
+	echo A:bar >input &&
+	git send-pack remote.git --stdin B:foo <input &&
+	cat >expect <<-\EOF &&
+	refs/heads/foo
+	refs/heads/bar
+	EOF
+	test_cmp expect remote.git/pushed-refs &&
+	verify_push B foo &&
+	verify_push A bar
+'
+
 test_expect_success 'cmdline refs written in order' '
 	clear_remote &&
 	test_must_fail git send-pack remote.git A:foo B:foo 2>err &&
-- 
2.55.0
Technical Details
Message-ID: <20261009192953.81794-10-jon@jonsimons.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!git+bounces-71630-linux-kernel-git=dewy.ru
References: <20261009192953.81794-1-jon@jonsimons.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!git+bounces-71630-linux-kernel-git=dewy.ru
From: jon@jonsimons.org (Jon Simons)
Newsgroups: linux.kernel.git
Subject: [PATCH 09/15] t5408: check refspec order with distinct destinations
Date: Fri,  9 Oct 2026 15:29:47 -0400
Organization: Usenet Network
Message-ID: <20261009192953.81794-10-jon@jonsimons.org>
References: <20261009192953.81794-1-jon@jonsimons.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="1181309"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:96KTWKsDYBzdqnz6Hbl0Ul4Qa34= sha256:gMslV5SrR/G3Sx3c1IbalS6LQMTI6qXp1XhK+9CmPqU=
	sha1:FwQJSMOJLXPjI9B77UgkacrLa50= sha256:tuUTlvbD9BMhaBo/ayRV0BZ6HmLvHDFOQJr2Z5AhoSI=
List-ID: <git.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 5E06410F7CA; Fri,  9 Oct 2026 22:40:21 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.05
X-Spam-Status: No, score=-3.05 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key)
	header.d=jonsimons.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id 34ySf_e5n6m7;
	Fri,  9 Oct 2026 22:40:18 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=git+bounces-71630-linux-kernel-git=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=jonsimons.org
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 3C84A10F7C2; Fri,  9 Oct 2026 22:40:14 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
	by tor.lore.kernel.org (Postfix) with ESMTP id 38063274DA; Fri,  9 Oct 2026 19:37:17 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 5E15E43CEDD;
	Fri,  9 Oct 2026 19:37:12 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key) header.d=jonsimons.org header.i=@jonsimons.org header.b="I5hZbuT2"
X-Received: from smtp94.iad3b.emailsrvr.com (smtp94.iad3b.emailsrvr.com [146.20.161.94])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 949634F4728
	for <git@vger.kernel.org>; Fri,  9 Oct 2026 19:37:03 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=146.20.161.94
X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1791574630; cv=none; b=AFDMzXzsWFpTRPJsyQ/oa9FUnakgdpk8+TTEuynrWOzt7gUOwS95lJPEBzNZGukYqkAAtvhaRw90Za8JF7RzcooiPKNnbnn09uqQBHmkajmXS4YP4fIONgDUxymRGKeckh1FeBs9kMUBJC+mvZ9SFm+wTZtJa9yeQLXtEhX2l8k=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1791574630; c=relaxed/simple;
	bh=HCR+uyaLeG5ZGMwMPkwtKzpoMZLt/2K/6Ew13JPoFMU=;
	h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:
	 MIME-Version; b=l9prMjFraLRzaST9qbF/llVYKi8DEE3wm3zZsl+QBLCaM6ySyTN3hUcf/1HgxjYUwc0rKTNxvKIuZyOrtBBdWHcK9+oc2834lTTBSLX2DPqQyxpU5QD/l+knr5KKctRSuZ/rMqEBqiwrVGl2G9StkJtnmD39oIfjUPyR+2sCIEs=
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=jonsimons.org; spf=pass smtp.mailfrom=jonsimons.org; dkim=pass (1024-bit key) header.d=jonsimons.org header.i=@jonsimons.org header.b=I5hZbuT2; arc=none smtp.client-ip=146.20.161.94
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=jonsimons.org
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=jonsimons.org
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=jonsimons.org;
	s=20200911-u7gnnm7o; t=1791574222;
	bh=HCR+uyaLeG5ZGMwMPkwtKzpoMZLt/2K/6Ew13JPoFMU=;
	h=From:To:Subject:Date:From;
	b=I5hZbuT2fbXAA2+IqgwmC+0DJG4elXBKoZ/4doAOFmB5+OOOv8rQPIqqnGY9ZA0hH
	 sidIHqgWqCG0Er6DSyy5sXRgfNw2h5mGQM0tQ0Kunr5HQD/RpPZJvNOZ7s7tqDuEuj
	 buWLLGqG4jqT4QJfgZquyFylcfBNHvbVEHfl7mdI=
X-Auth-ID: jon@jonsimons.org
X-Received: by smtp4.relay.iad3b.emailsrvr.com (Authenticated sender: jon-AT-jonsimons.org) with ESMTPSA id 7E9F120392;
	Fri,  9 Oct 2026 15:30:22 -0400 (EDT)
X-Cc: Jon Simons <jon@jonsimons.org>
X-Mailer: git-send-email 2.55.0
X-In-Reply-To: <20261009192953.81794-1-jon@jonsimons.org>
X-Precedence: bulk
X-Mailing-List: git@vger.kernel.org
X-List-Subscribe: <mailto:git+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:git+unsubscribe@vger.kernel.org>
X-Classification-ID: 523ad08c-aaf2-41d9-9ffc-58ea03a01763-10-1