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>
Junio C Hamano committed
Jun 17, 2013 at 09:52 UTC
46ab7d46ca8ae98411450f077b3023e0b7e03ea9
1 file changed
+9
-1
t/t7512-status-help.sh
+9
-1
@@ -667,7 +667,7 @@ test_expect_success 'status when cherry-picking after resolving conflicts' '
667
test_i18ncmp expected actual
668
'
669
670
-test_expect_success 'status showing detached from a tag' '
670
+test_expect_success 'status showing detached at and from a tag' '
671
test_commit atag tagging &&
672
git checkout atag &&
673
cat >expected <<-\EOF
@@ -675,6 +675,14 @@ test_expect_success 'status showing detached from a tag' '
675
nothing to commit (use -u to show untracked files)
676
EOF
677
git status --untracked-files=no >actual &&
678
+ test_i18ncmp expected actual &&
679
+
680
+ git reset --hard HEAD^ &&
681
+ cat >expected <<-\EOF
682
+ # HEAD detached from atag
683
+ nothing to commit (use -u to show untracked files)
684
+ EOF
685
+ git status --untracked-files=no >actual &&
686
test_i18ncmp expected actual
687
'
688