Skip to content

Commit 9cb07d8

Browse files
moygitster
authored andcommitted
t3203: test 'detached at' after checkout --detach
This currently fails: the output is 'HEAD detached at HEAD'. Signed-off-by: Matthieu Moy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 74b6763 commit 9cb07d8

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

t/t3203-branch-output.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,19 @@ EOF
106106
test_i18ncmp expect actual
107107
'
108108

109+
test_expect_failure 'git branch shows detached HEAD properly after checkout --detach' '
110+
git checkout master &&
111+
cat >expect <<EOF &&
112+
* (HEAD detached at $(git rev-parse --short HEAD^0))
113+
branch-one
114+
branch-two
115+
master
116+
EOF
117+
git checkout --detach &&
118+
git branch >actual &&
119+
test_i18ncmp expect actual
120+
'
121+
109122
test_expect_success 'git branch shows detached HEAD properly after moving' '
110123
cat >expect <<EOF &&
111124
* (HEAD detached from $(git rev-parse --short HEAD))

0 commit comments

Comments
 (0)