Skip to content

Commit 46ab7d4

Browse files
committed
t7512: test "detached from" as well
b397ea4 (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 <[email protected]>
1 parent edca415 commit 46ab7d4

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

t/t7512-status-help.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -667,14 +667,22 @@ test_expect_success 'status when cherry-picking after resolving conflicts' '
667667
test_i18ncmp expected actual
668668
'
669669

670-
test_expect_success 'status showing detached from a tag' '
670+
test_expect_success 'status showing detached at and from a tag' '
671671
test_commit atag tagging &&
672672
git checkout atag &&
673673
cat >expected <<-\EOF
674674
# HEAD detached at atag
675675
nothing to commit (use -u to show untracked files)
676676
EOF
677677
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 &&
678686
test_i18ncmp expected actual
679687
'
680688

0 commit comments

Comments
 (0)