Article View: linux.kernel.git
Article #217[PATCH 02/15] t5516: demonstrate push with "./"-prefixed source
From: Jon Simons
Date: Fri, 09 Oct 2026 19:29
Date: Fri, 09 Oct 2026 19:29
36 lines
6746 bytes
6746 bytes
'git push <repo> ./refs/heads/main:refs/heads/frotz' succeeds today and pushes refs/heads/main, although "./refs/heads/main" is not a valid refname. count_refspec_match() compares the source to each local ref using refname_match(), which formats its given name with mkpath(), whose cleanup_path() strips leading "./". Add a test_expect_failure asserting that such a source is rejected with "src refspec ./refs/heads/main does not match any". An upcoming commit stops using mkpath() in refname_match(), at which point the test is toggled to test_expect_success. Signed-off-by: Jon Simons <jon@jonsimons.org> --- t/t5516-fetch-push.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh index b982b209bf..aaeb251e2f 100755 --- a/t/t5516-fetch-push.sh +++ b/t/t5516-fetch-push.sh @@ -433,6 +433,12 @@ test_expect_success 'push with onelevel ref' ' test_must_fail git push testrepo HEAD:refs/onelevel ' +test_expect_failure 'push with "./"-prefixed src does not match any ref' ' + mk_test testrepo heads/main && + test_must_fail git push testrepo ./refs/heads/main:refs/heads/frotz 2>err && + test_grep "src refspec ./refs/heads/main does not match any" err +' + test_expect_success 'push with colon-less refspec (1)' ' mk_test testrepo heads/frotz tags/frotz && git branch -f frotz main && -- 2.55.0
Technical Details
Message-ID:
<20261009192953.81794-3-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-71638-linux-kernel-git=dewy.ruReferences:
<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-71638-linux-kernel-git=dewy.ru From: jon@jonsimons.org (Jon Simons) Newsgroups: linux.kernel.git Subject: [PATCH 02/15] t5516: demonstrate push with "./"-prefixed source Date: Fri, 9 Oct 2026 15:29:40 -0400 Organization: Usenet Network Message-ID: <20261009192953.81794-3-jon@jonsimons.org> References: <20261009192953.81794-1-jon@jonsimons.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="1181647"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:AHz5SWOlow6GqAoEzOvsOPGGI5Q= sha256:r8H+wm0fmFJFQCn3N6OkVMRcIyd7KUjETo3RFm+qjSc= sha1:KguTtr9hiIYQFCNQVAnSSC0eQ/s= sha256:3F9oqTB1HMqFLlX7+kL6520Hj0kHan29Iw6b9PnsRyo= 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 76BBB10F7CE; Fri, 9 Oct 2026 22:41:17 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -0.75 X-Spam-Status: No, score=-0.75 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, 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 0FwtwisJoPaJ; Fri, 9 Oct 2026 22:41:14 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=git+bounces-71638-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 94FA310F7C6; Fri, 9 Oct 2026 22:41:11 +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 A9FD631408; Fri, 9 Oct 2026 19:38:11 +0000 (UTC) X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 883C449C4CF; Fri, 9 Oct 2026 19:37:38 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=jonsimons.org header.i=@jonsimons.org header.b="izshtp2l" X-Received: from smtp90.iad3b.emailsrvr.com (smtp90.iad3b.emailsrvr.com [146.20.161.90]) (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 98ACA37A822 for <git@vger.kernel.org>; Fri, 9 Oct 2026 19:37:25 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=146.20.161.90 X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791574655; cv=none; b=MUGHIwn5c4fkaQkm9EkXs3FBDZOOdmREZ67EqrGvxq4QlkA4zokSOA4li3WPV7jCEsGe5R1Jkoc1VzWEO4tUHkRrmLRFN9PMyxZYMaGdVsiAsztIsfgPJsDWT9D0/xHL7uIg72t2bUVZNm3ozKi9qTycPH6Bwf19IQaRCiFOjuQ= X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791574655; c=relaxed/simple; bh=AFfwUTOgTxVIaceXOP8b476P6MlCOz2lsbFaeV97aCA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gs9oVWL3wylFg0oilmWFWUnw8A3A8nQPhWhwa6WdMCKdvyvz+Ze5wUkB7QhoSEdYbd4BWTIGD1sT+CbJvZAm+3yScDI94HMlTf2fEHZurn+9qh1pqQHm+QE9UHSgwX9GH6Rl7Sv2aZFpHiyaZHGQWzyS8kUKCXzln8w/6ufIckg= 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=izshtp2l; arc=none smtp.client-ip=146.20.161.90 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=1791574220; bh=AFfwUTOgTxVIaceXOP8b476P6MlCOz2lsbFaeV97aCA=; h=From:To:Subject:Date:From; b=izshtp2lWG7AHQHmyqT8J2Rn5mfBbuKf/3vh0fx3Lbr/Ecb6GpDltBluomH3vRZUk dqbLYHIEVpIVEu2sSeeMIie/POz4R5mo0NF1BX48kWauA0txtMJQRMI/mNRsgKV7sB hhseBBiT81dCgdgx5j8JqdeaMjhNsIufIMnsr77s= X-Auth-ID: jon@jonsimons.org X-Received: by smtp4.relay.iad3b.emailsrvr.com (Authenticated sender: jon-AT-jonsimons.org) with ESMTPSA id 2BE232038B; Fri, 9 Oct 2026 15:30:20 -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-3-1