mirror of
https://github.com/opnsense/src.git
synced 2026-06-08 16:22:46 -04:00
patch: further cleanup to git-style diffs.
Fix adding and removing files with git-style a/ b/ diffs: only skip six letters if they actually match "--- a/" and "+++ b/" instead of laxer checks. Obtained from: OpenBSD (CVS 1.59)
This commit is contained in:
parent
c844f14e37
commit
76df519fe0
1 changed files with 4 additions and 2 deletions
|
|
@ -311,14 +311,16 @@ intuit_diff_type(void)
|
|||
&names[OLD_FILE].exists, strippath);
|
||||
else if (strnEQ(s, "--- ", 4)) {
|
||||
size_t off = 4;
|
||||
if (piece_of_git && strippath == 957)
|
||||
if (piece_of_git && strippath == 957 &&
|
||||
strnEQ(s, "--- a/", 6))
|
||||
off = 6;
|
||||
names[NEW_FILE].path = fetchname(s + off,
|
||||
&names[NEW_FILE].exists, strippath);
|
||||
} else if (strnEQ(s, "+++ ", 4)) {
|
||||
/* pretend it is the old name */
|
||||
size_t off = 4;
|
||||
if (piece_of_git && strippath == 957)
|
||||
if (piece_of_git && strippath == 957 &&
|
||||
strnEQ(s, "+++ b/", 6))
|
||||
off = 6;
|
||||
names[OLD_FILE].path = fetchname(s + off,
|
||||
&names[OLD_FILE].exists, strippath);
|
||||
|
|
|
|||
Loading…
Reference in a new issue