git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/8] t5619: use fully qualified refname for branch

From
Jeff King <peff@peff.net>
Date
Apr 29, 2024, 08:21 UTC
Message-ID
<20240429082128.GA233423@coredump.intra.peff.net>

We use test_commit_bulk to update the ref "main". But without qualification, that is really creating ".git/main", not an actual branch in "refs/heads/".

In the end it does not really matter, because after creating "main" its only purpose is for us to point HEAD to its same commit id. And that works regardless of how we named it (the later call to update-ref just calls it "main", but that is OK; we are resolving it to an oid there, so our DWIM logic will find it in "refs/heads/").

Since it seems like going outside of "refs/" was accidental here, let's do the more normal thing and just use a branch. That makes the test less confusing and will future proof us against ref updates becoming more picky.

Signed-off-by: Jeff King <peff@peff.net>
---
 t/t5619-clone-local-ambiguous-transport.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/t5619-clone-local-ambiguous-transport.sh b/t/t5619-clone-local-ambiguous-transport.sh
index cce62bf78d..70db437496 100755
--- a/t/t5619-clone-local-ambiguous-transport.sh
+++ b/t/t5619-clone-local-ambiguous-transport.sh
@@ -21,7 +21,7 @@ test_expect_success 'setup' '
 	echo "secret" >sensitive/secret &&
 
 	git init --bare "$REPO" &&
-	test_commit_bulk -C "$REPO" --ref=main 1 &&
+	test_commit_bulk -C "$REPO" --ref=refs/heads/main 1 &&
 
 	git -C "$REPO" update-ref HEAD main &&
 	git -C "$REPO" update-server-info &&
-- 
2.45.0.rc1.416.gbe2a76c799
Message 1 of 1 in “t5619: use fully qualified refname for branch”
  1. 2/8 t5619: use fully qualified refname for branchJeff King, Apr 29, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.