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

[PATCH 1/2] t3203: test 'detached at' after checkout --detach

From
Matthieu Moy <matthieu.moy@imag.fr>
Date
Sep 27, 2015, 15:13 UTC
Message-ID
<1443366822-1753-1-git-send-email-Matthieu.Moy@imag.fr>
This currently fails: the output is 'HEAD detached at HEAD'.
---
 t/t3203-branch-output.sh | 13 +++++++++++++
 1 file changed, 13 insertions(+)
diff --git a/t/t3203-branch-output.sh b/t/t3203-branch-output.sh
index f51d0f3..bf24dbf 100755
--- a/t/t3203-branch-output.sh
+++ b/t/t3203-branch-output.sh
@@ -106,6 +106,19 @@ EOF
 	test_i18ncmp expect actual
 '
 
+test_expect_failure 'git branch shows detached HEAD properly after checkout --detach' '
+	git checkout master &&
+	cat >expect <<EOF &&
+* (HEAD detached at $(git rev-parse --short HEAD^0))
+  branch-one
+  branch-two
+  master
+EOF
+	git checkout --detach &&
+	git branch >actual &&
+	test_i18ncmp expect actual
+'
+
 test_expect_success 'git branch shows detached HEAD properly after moving' '
 	cat >expect <<EOF &&
 * (HEAD detached from $(git rev-parse --short HEAD))
-- 
2.5.0.402.g8854c44
Next: Matthieu Moy
Message 1 of 4 in “t3203: test 'detached at' after checkout --detach”
  1. 1/2 t3203: test 'detached at' after checkout --detachMatthieu Moy, Sep 27, 2015
  2. 2/2 status: don't say 'HEAD detached at HEAD'Matthieu Moy, Sep 27, 2015
  3. Michael J GruberOct 1, 2015
  4. Matthieu MoyOct 1, 2015

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.