Skip to content

Commit

Permalink
t7512: test "detached from" as well
Browse files Browse the repository at this point in the history
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 <gitster@pobox.com>
  • Loading branch information
Junio C Hamano committed Jun 17, 2013
1 parent edca415 commit 46ab7d4
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion t/t7512-status-help.sh
Original file line number Diff line number Diff line change
Expand Up @@ -667,14 +667,22 @@ 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
# HEAD detached at atag
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
'

Expand Down

0 comments on commit 46ab7d4

Please sign in to comment.