Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@suse.de>2010-01-17 05:05:10 +0300
committerJunio C Hamano <gitster@pobox.com>2010-01-18 21:32:05 +0300
commit158620872737067e4a74ca7aed5302af8debb714 (patch)
treef6d80d07207cff8387c93b9ce32f2de290757e68 /t/t4120-apply-popt.sh
parent902f235378cb2b2f6dd5dd664b9630c95321f0ae (diff)
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-xt/t4120-apply-popt.sh5
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