summaryrefslogtreecommitdiff
path: root/t/t7512-status-help.sh
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2013-06-17 09:52:25 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2013-06-17 09:56:32 -0700
commit46ab7d46ca8ae98411450f077b3023e0b7e03ea9 (patch)
treee15e7ec1ee46a16fe8c28ee8a73f40565cfd91f1 /t/t7512-status-help.sh
parentGit 1.8.3 (diff)
downloadtgif-46ab7d46ca8ae98411450f077b3023e0b7e03ea9.tar.xz
t7512: test "detached from" as well
b397ea4863a1 (status: show more info than "currently not on any branch", 2013-03-13) wanted to make sure that after a checkout to detach HEAD, the user can see where the HEAD was originally detached from. The last test added by that commit to t7512 shows one example, immediately after HEAD is detached. Enhance that test to show "detached HEAD from" form that should be shown when the user further resetted to another commit. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7512-status-help.sh')
-rwxr-xr-xt/t7512-status-help.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/t/t7512-status-help.sh b/t/t7512-status-help.sh
index bf08d4e098..bafa5e7715 100755
--- a/t/t7512-status-help.sh
+++ b/t/t7512-status-help.sh
@@ -667,7 +667,7 @@ test_expect_success 'status when cherry-picking after resolving conflicts' '
test_i18ncmp expected actual
'
-test_expect_success 'status showing detached from a tag' '
+test_expect_success 'status showing detached at and from a tag' '
test_commit atag tagging &&
git checkout atag &&
cat >expected <<-\EOF
@@ -675,6 +675,14 @@ test_expect_success 'status showing detached from a tag' '
nothing to commit (use -u to show untracked files)
EOF
git status --untracked-files=no >actual &&
+ test_i18ncmp expected actual &&
+
+ git reset --hard HEAD^ &&
+ cat >expected <<-\EOF
+ # HEAD detached from atag
+ nothing to commit (use -u to show untracked files)
+ EOF
+ git status --untracked-files=no >actual &&
test_i18ncmp expected actual
'