From 46ab7d46ca8ae98411450f077b3023e0b7e03ea9 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 17 Jun 2013 09:52:25 -0700 Subject: [PATCH] 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 --- t/t7512-status-help.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 ' -- 2.11.4.GIT