summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2015-10-16 14:32:44 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2015-10-16 14:32:44 -0700
commitdf64186f63fef8daef0fb4aedfa76aaf22b70b75 (patch)
tree5676bddfa26659f1070af362d2c864a97937c735 /t
parentMerge branch 'gr/rebase-i-drop-warn' into maint (diff)
parentstatus: don't say 'HEAD detached at HEAD' (diff)
downloadtgif-df64186f63fef8daef0fb4aedfa76aaf22b70b75.tar.xz
Merge branch 'mm/detach-at-HEAD-reflog' into maint
After "git checkout --detach", "git status" reported a fairly useless "HEAD detached at HEAD", instead of saying at which exact commit. * mm/detach-at-HEAD-reflog: status: don't say 'HEAD detached at HEAD' t3203: test 'detached at' after checkout --detach
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 f51d0f3cad..16efe7af03 100755
--- a/t/t3203-branch-output.sh
+++ b/t/t3203-branch-output.sh
@@ -106,6 +106,19 @@ EOF
test_i18ncmp expect actual
'
+test_expect_success '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))