From: Junio C Hamano Date: Fri, 7 Sep 2012 18:09:26 +0000 (-0700) Subject: Merge branch 'jc/apply-binary-p0' X-Git-Tag: v1.8.0-rc0~93 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=757bf26c8512c21e841f75d16be624eb7fb4272c;p=git.git Merge branch 'jc/apply-binary-p0' "git apply -p0" did not parse pathnames on "diff --git" line correctly. This caused patches that had pathnames in no other places to be mistakenly rejected (most notably, binary patch that does not rename nor change mode). Textual patches, renames or mode changes have preimage and postimage pathnames in different places in a form that can be parsed unambiguously and did not suffer from this problem. * jc/apply-binary-p0: apply: compute patch->def_name correctly under -p0 --- 757bf26c8512c21e841f75d16be624eb7fb4272c diff --cc t/t4103-apply-binary.sh index 99627bc6d,1b420e3b5..b1b906b1b --- a/t/t4103-apply-binary.sh +++ b/t/t4103-apply-binary.sh @@@ -8,30 -8,28 +8,28 @@@ test_description='git apply handling bi ' . ./test-lib.sh - # setup - - cat >file1 <file2 - cat file1 >file4 - - test_expect_success 'setup' " + test_expect_success 'setup' ' + cat >file1 <<-\EOF && + A quick brown fox jumps over the lazy dog. + A tiny little penguin runs around in circles. + There is a flag with Linux written on it. + A slow black-and-white panda just sits there, + munching on his bamboo. + EOF + cat file1 >file2 && + cat file1 >file4 && + git update-index --add --remove file1 file2 file4 && - git commit -m 'Initial Version' 2>/dev/null && + git commit -m "Initial Version" 2>/dev/null && git checkout -b binary && - "$PERL_PATH" -pe 'y/x/\000/' file3 && - perl -pe "y/x/\000/" file3 && ++ "$PERL_PATH" -pe "y/x/\000/" file3 && cat file3 >file4 && git add file2 && - "$PERL_PATH" -pe 'y/\000/v/' file1 && - perl -pe "y/\000/v/" file1 && ++ "$PERL_PATH" -pe "y/\000/v/" file1 && rm -f file2 && git update-index --add --remove file1 file2 file3 file4 && - git commit -m 'Second Version' && + git commit -m "Second Version" && git diff-tree -p master binary >B.diff && git diff-tree -p -C master binary >C.diff &&