diff options
author | Jonathan Nieder <jrnieder@gmail.com> | 2010-09-29 16:41:08 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-11-10 08:42:40 -0800 |
commit | 2d502e1f378a39ef375d6d5c1b3312d286ed2524 (patch) | |
tree | ed9fa8c801dd2c06b0b3bb67818ea98e6ed1e1a0 /t/t4135-apply-weird-filenames.sh | |
parent | a1980c4efcfea516e2ba442bf7e56a39d9a7933f (diff) | |
download | git-2d502e1f378a39ef375d6d5c1b3312d286ed2524.tar.gz |
apply: handle patches with funny filename and colon in timezone
Some patches have a timezone formatted like '-08:00' instead of
'-0800' in their ---/+++ lines (e.g. http://lwn.net/Articles/131729/).
Take this into account when searching for the start of the timezone
(which is the end of the filename).
This does not actually affect the outcome of patching unless (1) a
file being patched has a non-' ' whitespace character (e.g., tab) in
its filename, or (2) the patch is whitespace-damaged, so the tab
between filename and timestamp has been replaced with spaces.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4135-apply-weird-filenames.sh')
-rwxr-xr-x | t/t4135-apply-weird-filenames.sh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/t/t4135-apply-weird-filenames.sh b/t/t4135-apply-weird-filenames.sh index 1e5aad57ab..bf5dc57286 100755 --- a/t/t4135-apply-weird-filenames.sh +++ b/t/t4135-apply-weird-filenames.sh @@ -72,4 +72,20 @@ test_expect_success 'whitespace-damaged traditional patch' ' test_cmp expected postimage.txt ' +test_expect_success 'traditional patch with colon in timezone' ' + echo postimage >expected && + reset_preimage && + rm -f "post image.txt" && + git apply "$vector/funny-tz.diff" && + test_cmp expected "post image.txt" +' + +test_expect_success 'traditional, whitespace-damaged, colon in timezone' ' + echo postimage >expected && + reset_preimage && + rm -f "post image.txt" && + git apply "$vector/damaged-tz.diff" && + test_cmp expected "post image.txt" +' + test_done |