summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorMatthieu Moy <Matthieu.Moy@imag.fr>2015-09-27 15:13:41 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-10-02 18:29:16 (GMT)
commit9cb07d81b3b268dc5f88f7048f54ce51d363d2d5 (patch)
tree615693e971877ad995497f50a799b1d454144833 /t
parent74b67638166ca2e66497ede559dbf393e7af8b40 (diff)
downloadgit-9cb07d81b3b268dc5f88f7048f54ce51d363d2d5.zip
git-9cb07d81b3b268dc5f88f7048f54ce51d363d2d5.tar.gz
git-9cb07d81b3b268dc5f88f7048f54ce51d363d2d5.tar.bz2
t3203: test 'detached at' after checkout --detach
This currently fails: the output is 'HEAD detached at HEAD'. Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t3203-branch-output.sh13
1 files changed, 13 insertions, 0 deletions
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))