summaryrefslogtreecommitdiff
path: root/t/t3203-branch-output.sh
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2013-03-13 18:42:53 +0700
committerJunio C Hamano <gitster@pobox.com>2013-03-16 22:11:02 -0700
commitc8183cd2851965665655738fc399c44f546d5b79 (patch)
tree7d8f2eb8b9c904ca8e7bbbc4360b412264a6c9a6 /t/t3203-branch-output.sh
parentb397ea4863a143e97cb9da76c6c18cc555537d64 (diff)
downloadgit-c8183cd2851965665655738fc399c44f546d5b79.tar.gz
branch: show more information when HEAD is detached
This prints more helpful info when HEAD is detached: is it detached because of bisect or rebase? What is the original branch name in those cases? Is it detached because the user checks out a remote ref or a tag (and which one)? Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3203-branch-output.sh')
-rwxr-xr-xt/t3203-branch-output.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/t/t3203-branch-output.sh b/t/t3203-branch-output.sh
index 76fe7e0060..ba4f98e800 100755
--- a/t/t3203-branch-output.sh
+++ b/t/t3203-branch-output.sh
@@ -94,13 +94,13 @@ test_expect_success 'git branch -v pattern does not show branch summaries' '
test_must_fail git branch -v branch*
'
-cat >expect <<'EOF'
-* (no branch)
+test_expect_success 'git branch shows detached HEAD properly' '
+ cat >expect <<EOF &&
+* (detached from $(git rev-parse --short HEAD^0))
branch-one
branch-two
master
EOF
-test_expect_success 'git branch shows detached HEAD properly' '
git checkout HEAD^0 &&
git branch >actual &&
test_i18ncmp expect actual