Package: git
Version: 1:1.7.9-1
Tags: upstream
Forwarded: http://thread.gmane.org/gmane.comp.version-control.git/139870

When git diff -M -B detects a rename that also overwrites an existing 
file, the resulting patch incorrectly omits the deletion of the 
overwritten file, so it cannot be applied to its own source tree.

$ git init
$ seq 100 200 > a; seq 300 400 > b; git add a b
$ git commit -m foo; git tag foo
$ git mv -f a b
$ git commit -m bar; git tag bar
$ git checkout foo
$ git diff -M -B foo bar
diff --git a/a b/b
similarity index 100%
rename from a
rename to b
$ git diff -M -B foo bar | git apply
error: b: already exists in working directory

If the patch began with a hunk for deleting the overwritten file (as it 
would for a deleted file that isn’t overwritten), then it could be 
forward- and reverse-applied without problems.

Anders



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to