diff options
author | Junio C Hamano <gitster@pobox.com> | 2008-05-17 01:51:31 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-05-17 01:51:31 -0700 |
commit | 5c47f4c6e71e6de08348f837f38a446a2f2b0ed7 (patch) | |
tree | c3f388e53beec55d52e14015cbdc3b7771827702 /bundle.h | |
parent | 88f6dbaf99f43053f86474b28beedd91e77c64d9 (diff) | |
download | git-5c47f4c6e71e6de08348f837f38a446a2f2b0ed7.tar.gz git-5c47f4c6e71e6de08348f837f38a446a2f2b0ed7.tar.xz |
builtin-apply: accept patch to an empty file
A patch from a foreign SCM (or plain "diff" output) often have both
preimage and postimage filename on ---/+++ lines even for a patch that
creates a new file. However, when there is a filename for preimage, we
used to insist the file to exist (either in the work tree and/or in the
index). When we cannot be sure by parsing the patch that it is not a
creation patch, we shouldn't complain when if there is no such a file.
This commit fixes the logic.
Refactor the code that validates the preimage file into a separate
function while we are at it, as it is getting rather big.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'bundle.h')
0 files changed, 0 insertions, 0 deletions