status: don't say 'HEAD detached at HEAD'
After using "git checkout --detach", the reflog is left with an entry like checkout: moving from ... to HEAD This message is parsed to generate the 'HEAD detached at' message in 'git branch' and 'git status', which leads to the not-so-useful message 'HEAD detached at HEAD'. Instead, when parsing such reflog entry, resolve HEAD to the corresponding commit in the reflog, so that the message becomes 'HEAD detached at $sha1'. Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
9cb07d81b3
commit
0eb8548f45
@ -106,7 +106,7 @@ EOF
|
||||
test_i18ncmp expect actual
|
||||
'
|
||||
|
||||
test_expect_failure 'git branch shows detached HEAD properly after checkout --detach' '
|
||||
test_expect_success 'git branch shows detached HEAD properly after checkout --detach' '
|
||||
git checkout master &&
|
||||
cat >expect <<EOF &&
|
||||
* (HEAD detached at $(git rev-parse --short HEAD^0))
|
||||
|
Reference in New Issue
Block a user