diff options
author | Junio C Hamano <gitster@pobox.com> | 2020-09-09 22:53:08 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-09-09 22:53:09 +0200 |
commit | 0df670bc0b8b5499859829ba0889ce96a75304a6 (patch) | |
tree | e95738e380852775d16806643a57ece2d4d39461 /t/t7508-status.sh | |
parent | Merge branch 'js/ci-squelch-false-failure' (diff) | |
parent | wt-status: tolerate dangling marks (diff) | |
download | git-0df670bc0b8b5499859829ba0889ce96a75304a6.tar.xz git-0df670bc0b8b5499859829ba0889ce96a75304a6.zip |
Merge branch 'jt/interpret-branch-name-fallback'
"git status" has trouble showing where it came from by interpreting
reflog entries that recordcertain events, e.g. "checkout @{u}", and
gives a hard/fatal error. Even though it inherently is impossible
to give a correct answer because the reflog entries lose some
information (e.g. "@{u}" does not record what branch the user was
on hence which branch 'the upstream' needs to be computed, and even
if the record were available, the relationship between branches may
have changed), at least hide the error to allow "status" show its
output.
* jt/interpret-branch-name-fallback:
wt-status: tolerate dangling marks
refs: move dwim_ref() to header file
sha1-name: replace unsigned int with option struct
Diffstat (limited to 't/t7508-status.sh')
-rwxr-xr-x | t/t7508-status.sh | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/t/t7508-status.sh b/t/t7508-status.sh index e81759319f..45e1f6ff68 100755 --- a/t/t7508-status.sh +++ b/t/t7508-status.sh @@ -846,6 +846,18 @@ test_expect_success 'status refreshes the index' ' test_cmp expect output ' +test_expect_success 'status shows detached HEAD properly after checking out non-local upstream branch' ' + test_when_finished rm -rf upstream downstream actual && + + test_create_repo upstream && + test_commit -C upstream foo && + + git clone upstream downstream && + git -C downstream checkout @{u} && + git -C downstream status >actual && + test_i18ngrep "HEAD detached at [0-9a-f]\\+" actual +' + test_expect_success 'setup status submodule summary' ' test_create_repo sm && ( cd sm && |