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

[PATCH] Test :/string form for checkout

From
Daniel Barkalow <barkalow@iabervon.org>
Date
Feb 2, 2008, 09:37 UTC
Message-ID
<alpine.LNX.1.00.0802020435560.13593@iabervon.org>
Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
---
Here it is as a case in the test suite.
 t/t7201-co.sh |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/t/t7201-co.sh b/t/t7201-co.sh
index 73d8a00..dbf1ace 100755
--- a/t/t7201-co.sh
+++ b/t/t7201-co.sh
@@ -214,6 +214,22 @@ test_expect_success 'checkout to detach HEAD with branchname^' '
 	fi
 '
 
+test_expect_success 'checkout to detach HEAD with :/message' '
+
+	git checkout -f master && git clean -f &&
+	git checkout ":/Initial" &&
+	H=$(git rev-parse --verify HEAD) &&
+	M=$(git show-ref -s --verify refs/heads/master) &&
+	test "z$H" = "z$M" &&
+	if git symbolic-ref HEAD >/dev/null 2>&1
+	then
+		echo "OOPS, HEAD is still symbolic???"
+		false
+	else
+		: happy
+	fi
+'
+
 test_expect_success 'checkout to detach HEAD with HEAD^0' '
 
 	git checkout -f master && git clean -f &&
-- 
1.5.4
Message 1 of 1 in “Test :/string form for checkout”
  1. Test :/string form for checkoutDaniel Barkalow, Feb 2, 2008

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.