Re: git-checkout changes the index but not the checked out files?
- From
Martin Langhoff <martin.langhoff@gmail.com>
- Date
- Apr 23, 2007, 00:17 UTC
- Message-ID
- <46a038f90704221717i8e5c1bkff066dcbdb0a0523@mail.gmail.com>
- In-Reply-To
- <7virbokmx1.fsf@assigned-by-dhcp.cox.net>
On 4/23/07, Junio C Hamano <junkio@cox.net> wrote:
> Shouldn't happen. Details?
Hmnmm. Not sure really what to look for ;-)
If I try it on my git checkout (checkout origin/pu and then checkout master) nothing strange happens. But if I do it on my project, (fetchable from http://git.catalyst.net.nz/moodle-r2.git ) between a "local" mdl18-local and origin/MOODLE_18_STABLE, it all goes weird.
Just re-ran the process with bash -x, and it switches to a detached head when going to origin/MOODLE_18_STABLE (as expected). And when switching back, it all looks _almost_ reasonable except that there's a call to git-read-tree with -m and 2 sha1s. It is trying to merge mdl18-local and mdl18-topnz apparently.
In fact:
- I am on mdl18-local - git-status is clean - git checkout mdl18-local reports "Already on branch "mdl18-local" but it does a merge anyway
The problem seems to be that the SHA1 returned here is bogus:
$ git-rev-parse --verify 'mdl18-local^0' warning: refname 'mdl18-local' is ambiguous. a26c09be05a08e5f911ef84b5f8010ba155ea77d
If I disambiguate it one way or the other, I get correct results
$ git-rev-parse --verify 'refs/heads/mdl18-local^0' 634dcf72a31d0c75a98c1d69dd4763def7bcf2d5 $ git-rev-parse --verify 'remotes/origin/mdl18-local^0' 6e6ae22a2960d3ac321acd1cdfa09f23068f33b4
but the ambiguous "git-rev-parse --verify 'mdl18-local^0'" returns the SHA1 for a head called 'mdl18-topnz' that I am not asking for. Why?
cheers,
m