Re: git diff-files weirdness (bug?)
- From
Linus Torvalds <torvalds@linux-foundation.org>
- Date
- May 23, 2008, 16:14 UTC
- Message-ID
- <alpine.LFD.1.10.0805230906110.3081@woody.linux-foundation.org>
- In-Reply-To
- <b0943d9e0805230720h61cbabbbw180908e1b28a34cc@mail.gmail.com>
Looks like a real bug.
On Fri, 23 May 2008, Catalin Marinas wrote:
Show 19 quoted lines
> > I was investigating a bug in "stg refresh" failing with moved files > and noticed that it was caused by Git (HEAD pulled yesterday): > > git init > touch a > git add a > git commit -m "test" > git mv a b > > These are OK: > > git diff-files -- a > git diff-files -- b > > These fail: > > git diff-files -- a b > git diff-files -- a c
Yes, that's buggy.
What happens is that we get to run_diff_files_cmd(), but then we don't actually do "run_diff_files()", because we go into the NO_INDEX case:
if (DIFF_OPT_TST(&revs->diffopt, NO_INDEX)) {
...instead.
Which in turn is because "setup_diff_no_index()" is broken.
And I think "setup_diff_no_index()" is broken exactly because it sees that '--' and then totally ignores it and says "if I see two paths, we'll say it's the non-index case".
Linus