apply: demonstrate a problem applying svn diffs
Subversion generates diffs that contain funny ---/+++ lines containing more than just the file names. Example: --- a/trunk/README (revision 4711) +++ /dev/null (nonexistent) Let's add a test case demonstrating that apply cannot handle the /dev/null line (although it can handle the trunk/README line just fine). Reported in https://github.com/git-for-windows/git/issues/1489 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Schindelin committed
Feb 15, 2018 at 01:29 UTC
f16ef7bd4c37fba8c030b87610f646a1fce5d52d
1 file changed
+17
t/t4135-apply-weird-filenames.sh
+17
@@ -89,4 +89,21 @@ test_expect_success 'traditional, whitespace-damaged, colon in timezone' '
89
test_cmp expected "post image.txt"
90
'
91
92
+cat >diff-from-svn <<\EOF
93
+Index: Makefile
94
+===================================================================
95
+diff --git a/branches/Makefile
96
+deleted file mode 100644
97
+--- a/branches/Makefile (revision 13)
98
++++ /dev/null (nonexistent)
99
+@@ +1 0,0 @@
100
+-
101
+EOF
102
+
103
+test_expect_failure 'apply handles a diff generated by Subversion' '
104
+ >Makefile &&
105
+ git apply -p2 diff-from-svn &&
106
+ test_path_is_missing Makefile
107
+'
108
+
109
test_done