Which is wrong? diff or apply?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Today, I tried this in my git.git checkout:

  $ mv transport-helper.c wt-status.c
  $ git diff -B -M | git apply --cached
  error: wt-status.c: already exists in index

That is, I overwrote the tracked wt-status.c with a completly different file 
that is also tracked. Then I try to stage the change using git apply.

git diff -B -M reports this:

  diff --git a/transport-helper.c b/wt-status.c
  similarity index 100%
  rename from transport-helper.c
  rename to wt-status.c

Notice that there is no mention that the previously existing wt-status.c was 
removed. I wonder whether this is a bug.

Or is it the safety valve in git apply that does not allow to overwrite an 
existing file which should not trigger in this case?

-- Hannes
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]