Thread (2 messages) flat view 2 messages, 2 authors, 2016-06-15

Re: git-apply fails on creating a new file, with both -p and --directory specified

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:47:51
Subsystem: the rest · Maintainer: Linus Torvalds

Possibly related (same subject, not in this thread)

James Vega [off-list ref] writes:
It looks like this may have introduced a bug when staging a file
removal.  Here's an example git session showing the issue:
<<snipped>>
Thanks for a report, but I cannot get the evidence that the said patch has
anything to do with the issue you illustrated.

$ cat >patch0 <<\EOF
diff --git a/foo b/foo
deleted file mode 100644
index 257cc56..0000000
--- a/foo
+++ /dev/null
@@ -1 +0,0 @@
-foo
EOF
$ git apply --numstat patch0
0	1	foo
$ sed -e '/deleted file/d' patch0 | git apply --numstat
0	1	dev/null

The last one is showing the symptom in your message.  Git versions 1.4.0
and newer yield the same result, but 1.3.0 gives a funny message:

        ** warning: file dev/null becomes empty but is not deleted
        0       1       foo

So it appears that the bug is somewhere else not in that patch.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help