# [BUG] "git diff FILE BRANCH:FILE" erroneously report FILE does not exist in BRANCH

3 messages from 2012-01-21 to 2012-01-21. Participants: Stefano Lattarini, Carlos Martín Nieto, Junio C Hamano.
Thread: https://gitlist.dev/t/29420

## Stefano Lattarini, 2012-01-21 19:36

Subject: [BUG] "git diff FILE BRANCH:FILE" erroneously report FILE does not exist in BRANCH
Message-ID: <4F1B13BB.8070603@gmail.com>
URL: https://gitlist.dev/e/4F1B13BB.8070603%40gmail.com

```
Here is a complete reproducer for the bug:

mkdir foo \
  && cd foo \
  && git init . \
  && >README \
  && git add README \
  && git commit -m "for all" \
  && git checkout -b devel \
  && echo dev > README \
  && git add README \
  && git commit -m "for developers" \
  && git diff devel:README master:README \
  && git diff README master:README

I'd expect the last "git diff" to report the same diffs as the previous one;
instead, it errors out with this bogus message:

  fatal: Path 'README' exists on disk, but not in 'master'.

Behaviour verified with git version 1.7.7.3 (installed from official Debian
packages) and the latest git development version (1.7.9.rc0.69.gbddcef, from
master).

Regards, and thanks for your amazing software,
  Stefano

```

## Carlos Martín Nieto, 2012-01-21 21:33

Subject: Re: [BUG] "git diff FILE BRANCH:FILE" erroneously report FILE does not exist in BRANCH
Message-ID: <1327181608.31804.27.camel@centaur.lab.cmartin.tk>
URL: https://gitlist.dev/e/1327181608.31804.27.camel%40centaur.lab.cmartin.tk
In-Reply-To: <4F1B13BB.8070603@gmail.com>

```
On Sat, 2012-01-21 at 20:36 +0100, Stefano Lattarini wrote:
> I'd expect the last "git diff" to report the same diffs as the previous one;
> instead, it errors out with this bogus message:
> 
>   fatal: Path 'README' exists on disk, but not in 'master'.
> 
> Behaviour verified with git version 1.7.7.3 (installed from official Debian
> packages) and the latest git development version (1.7.9.rc0.69.gbddcef, from
> master).
> 

See http://thread.gmane.org/gmane.comp.version-control.git/188355 for
earlier discussion. I haven't gotten around to see if I can fix it
without upsetting too much code.

   cmn

```

## Junio C Hamano, 2012-01-21 22:08

Subject: Re: [BUG] "git diff FILE BRANCH:FILE" erroneously report FILE does not exist in BRANCH
Message-ID: <7v62g4btdy.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7v62g4btdy.fsf%40alter.siamese.dyndns.org
In-Reply-To: <4F1B13BB.8070603@gmail.com>

```
Stefano Lattarini <stefano.lattarini@gmail.com> writes:

>   && git diff README master:README

http://thread.gmane.org/gmane.comp.version-control.git/188355/focus=188414

```
