Merge branch 'jz/apply-3-corner-cases'

"git apply --3way" bypasses the attempt to do a three-way
application in more cases to address the regression caused by the
recent change to use direct application as a fallback.

* jz/apply-3-corner-cases:
  git-apply: skip threeway in add / rename cases
This commit is contained in:
Junio C Hamano
2022-01-10 11:52:53 -08:00
2 changed files with 21 additions and 1 deletions

View File

@ -3582,7 +3582,9 @@ static int try_threeway(struct apply_state *state,
/* No point falling back to 3-way merge in these cases */
if (patch->is_delete ||
S_ISGITLINK(patch->old_mode) || S_ISGITLINK(patch->new_mode))
S_ISGITLINK(patch->old_mode) || S_ISGITLINK(patch->new_mode) ||
(patch->is_new && !patch->direct_to_threeway) ||
(patch->is_rename && !patch->lines_added && !patch->lines_deleted))
return -1;
/* Preimage the patch was prepared for */