diff options
author | Andreas Gruenbacher <agruen@suse.de> | 2010-01-17 03:05:10 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-01-18 10:32:05 -0800 |
commit | 158620872737067e4a74ca7aed5302af8debb714 (patch) | |
tree | f6d80d07207cff8387c93b9ce32f2de290757e68 /t/t4120-apply-popt.sh | |
parent | 902f235378cb2b2f6dd5dd664b9630c95321f0ae (diff) | |
download | git-158620872737067e4a74ca7aed5302af8debb714.tar.gz |
builtin-apply.c: Skip filenames without enough components
find_name() wrongly returned the whole filename for filenames without
enough leading pathname components (e.g., when applying a patch to a
top-level file with -p2).
Include the -p value used in the error message when no filenames can be
found.
[jc: squashed a test from Nanako Shiraishi]
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4120-apply-popt.sh')
-rwxr-xr-x | t/t4120-apply-popt.sh | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/t/t4120-apply-popt.sh b/t/t4120-apply-popt.sh index 83d4ba6798..b463b4f05c 100755 --- a/t/t4120-apply-popt.sh +++ b/t/t4120-apply-popt.sh @@ -22,4 +22,9 @@ test_expect_success 'apply git diff with -p2' ' git apply -p2 patch.file ' +test_expect_success 'apply with too large -p' ' + test_must_fail git apply --stat -p3 patch.file 2>err && + grep "removing 3 leading" err +' + test_done |