]> git.ipfire.org Git - thirdparty/git.git/commit - merge-ort.c
merge-ort: ensure we consult df_conflict and path_conflicts
authorElijah Newren <newren@gmail.com>
Wed, 30 Jun 2021 17:29:59 +0000 (17:29 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 30 Jun 2021 21:40:10 +0000 (14:40 -0700)
commita492d5331cb93d8293e72741b4fb9e1ec4ff294b
treead292366e125ff2de9be2d2a87afc12828446362
parent806f83287f8d6c0568beed7ca5d603f936d53c40
merge-ort: ensure we consult df_conflict and path_conflicts

Path conflicts (typically rename path conflicts, e.g.
rename/rename(1to2) or rename/add/delete), and directory/file conflicts
should obviously result in files not being marked as clean in the merge.
We had a codepath where we missed consulting the path_conflict and
df_conflict flags, based on match_mask.  Granted, it requires an unusual
setup to trigger this codepath (directory rename causing rename-to-self
is the only case I can think of), but we still need to handle it.  To
make it clear that we have audited the other codepaths that do not
explicitly mention these flags, add some assertions that the flags are
not set.

Reported-by: Anders Kaseorg <andersk@mit.edu>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
merge-ort.c
t/t6423-merge-rename-directories.sh