diff options
author | Junio C Hamano <gitster@pobox.com> | 2015-11-03 15:13:08 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-11-03 15:13:08 -0800 |
commit | a59d1d8035a1a6d878274e97818c56bb691ac5c0 (patch) | |
tree | a7d71839d6df1c8764c7afa2ea4663a489afe2b2 /t | |
parent | Merge branch 'rs/show-branch-argv-array' (diff) | |
parent | wt-status: use skip_prefix() to get rid of magic string length constants (diff) | |
download | tgif-a59d1d8035a1a6d878274e97818c56bb691ac5c0.tar.xz |
Merge branch 'rs/wt-status-detached-branch-fix'
"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-x | t/t7060-wtstatus.sh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/t/t7060-wtstatus.sh b/t/t7060-wtstatus.sh index 32d81765cb..44bf1d84af 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 |