Re: git-checkout changes the index but not the checked out files?
- From
Linus Torvalds <torvalds@linux-foundation.org>
- Date
- Apr 23, 2007, 14:53 UTC
- Message-ID
- <alpine.LFD.0.98.0704230747110.9964@woody.linux-foundation.org>
- In-Reply-To
- <46a038f90704221745h1bf2955cyfb40f6e8c08a336d@mail.gmail.com>
On Mon, 23 Apr 2007, Martin Langhoff wrote:
> > The _really_ strange bit is that it was attempting to merge 2 heads of > the same name. It'd probably be something to block...
No, "git-read-tree -m A B" is not a "merge" in the sense you're thinking, it's a "fast-forward merge", ie just a "move from A to B"
So read-tree has three "merges": a one-way merge (which just merges with the old index _stat_ contents but otherwise just reads in the new tree), a two-way merge (a "move from A to B") that checks that all paths that are different in the two trees match the index in the old one, and the "real" merge, aka the three-way thing (and even that is actially "four-way", since it also checks the index for matchingness)
So when we move from one head to another, we do that two-way thing. And if A and B are the same, doesn't really do anything, but there's also no point to try to avoid doing it.
Linus