summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-11-05 20:18:15 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-11-05 20:18:15 (GMT)
commitdb43891ce60d0f713a41cfc46097262c73aa99d7 (patch)
tree02f8dc4fd41fceaf38a5430ef4f3596445aaff6c /t
parentf97aee1f941a08a741c7ce2b0dfb6db7d0cc042e (diff)
parentc72b49dfab8381abfd947db53c1c9e2da9593ab6 (diff)
downloadgit-db43891ce60d0f713a41cfc46097262c73aa99d7.zip
git-db43891ce60d0f713a41cfc46097262c73aa99d7.tar.gz
git-db43891ce60d0f713a41cfc46097262c73aa99d7.tar.bz2
Merge branch 'rs/wt-status-detached-branch-fix' into maint
"git status --branch --short" accessed beyond the constant string "HEAD", which has been corrected. * rs/wt-status-detached-branch-fix: wt-status: use skip_prefix() to get rid of magic string length constants wt-status: don't skip a magical number of characters blindly wt-status: avoid building bogus branch name with detached HEAD wt-status: exit early using goto in wt_shortstatus_print_tracking() t7060: add test for status --branch on a detached HEAD
Diffstat (limited to 't')
-rwxr-xr-xt/t7060-wtstatus.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/t/t7060-wtstatus.sh b/t/t7060-wtstatus.sh
index 32d8176..44bf1d8 100755
--- a/t/t7060-wtstatus.sh
+++ b/t/t7060-wtstatus.sh
@@ -213,5 +213,19 @@ EOF
git checkout master
'
+test_expect_success 'status --branch with detached HEAD' '
+ git reset --hard &&
+ git checkout master^0 &&
+ git status --branch --porcelain >actual &&
+ cat >expected <<-EOF &&
+ ## HEAD (no branch)
+ ?? .gitconfig
+ ?? actual
+ ?? expect
+ ?? expected
+ ?? mdconflict/
+ EOF
+ test_i18ncmp expected actual
+'
test_done