builtin-apply.c: Skip filenames without enough components
authorAndreas Gruenbacher <agruen@suse.de>
Sun, 17 Jan 2010 02:05:10 +0000 (03:05 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 18 Jan 2010 18:32:05 +0000 (10:32 -0800)
commit158620872737067e4a74ca7aed5302af8debb714
treef6d80d07207cff8387c93b9ce32f2de290757e68
parent902f235378cb2b2f6dd5dd664b9630c95321f0ae
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>
builtin-apply.c
t/t4120-apply-popt.sh