Matthieu Moy [off-list ref] writes:
I investigated a bit more. The root of the problem is "git checkout
--detach" and the reflog. Here's a reproduction script:
...
If one replaces "git checkout --detach" with "git checkout HEAD^0", then
the output is the one I expected:
HEAD detached at cb39b20
The guilty line in the reflog is:
checkout: moving from master to HEAD
Yeah, that sounds broken. --detach should write the same reflog entry
as "git checkout HEAD^0".