apply: handle filenames with double slashes better
commit33eb4dd9fce3b46b6962b46213d6f222bcd0cb3a
authorMichal Marek <mmarek@suse.cz>
Thu, 21 May 2009 12:25:11 +0000 (21 14:25 +0200)
committerJunio C Hamano <gitster@pobox.com>
Sun, 24 May 2009 20:52:13 +0000 (24 13:52 -0700)
treec09e8c7fc01526039d78d91865e4f0341f83aad0
parent7a7eb5173d4e16f0323b2c4078e88fc0a40c38b6
apply: handle filenames with double slashes better

When there are duplicated slashes in pathnames, like this:

--- a/perl//Git.pm
+++ b/perl//Git.pm
@@ -1358,3 +1358,4 @@

 1; # Famous last words
+# test

the paths gleaned from the patch header won't be found in the index and
cause "apply --index" and "apply --cached" to fail.

Fix this by squashing the duplicated slashes upon input.

Signed-off-by: Michal Marek <mmarek@suse.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-apply.c