diff options
author | Junio C Hamano <gitster@pobox.com> | 2012-08-24 22:48:55 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-08-24 23:11:05 -0700 |
commit | 6a2abdc12516cd3801bceef4ccfba399c962a074 (patch) | |
tree | 02990f9b784b1929e5b7e5b44f04c554cd610070 /t/t5515 | |
parent | Git 1.7.9 (diff) | |
download | tgif-6a2abdc12516cd3801bceef4ccfba399c962a074.tar.xz |
apply: compute patch->def_name correctly under -p0
Back when "git apply" was written, we made sure that the user can
skip more than the default number of path components (i.e. 1) by
giving "-p<n>", but the logic for doing so was built around the
notion of "we skip N slashes and stop". This obviously does not
work well when running under -p0 where we do not want to skip any,
but still want to skip SP/HT that separates the pathnames of
preimage and postimage and want to reject absolute pathnames.
Stop using "stop_at_slash()", and instead introduce a new helper
"skip_tree_prefix()" with similar logic but works correctly even for
the -p0 case.
This is an ancient bug, but has been masked for a long time because
most of the patches are text and have other clues to tell us the
name of the preimage and the postimage.
Noticed by Colin McCabe.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5515')
0 files changed, 0 insertions, 0 deletions