diff options
author | Junio C Hamano <gitster@pobox.com> | 2021-07-16 17:42:45 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-07-16 17:42:45 -0700 |
commit | d3b88be1b450caa1244ed756c2fd7d7baadeafd8 (patch) | |
tree | 85d3ade6a69a5e466bf9f09dc8cbb752824d442e /merge-ort.c | |
parent | fdbcdfcf61a64a1c2d2dd58c1a9111b45b6c1536 (diff) | |
parent | 3585d0ea232b1a9c5498ab5785b11f61e93967c8 (diff) | |
download | git-d3b88be1b450caa1244ed756c2fd7d7baadeafd8.tar.gz |
Merge branch 'en/merge-dir-rename-corner-case-fix'
The merge code had funny interactions between content based rename
detection and directory rename detection.
* en/merge-dir-rename-corner-case-fix:
merge-recursive: handle rename-to-self case
merge-ort: ensure we consult df_conflict and path_conflicts
t6423: test directory renames causing rename-to-self
Diffstat (limited to 'merge-ort.c')
-rw-r--r-- | merge-ort.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/merge-ort.c b/merge-ort.c index 4135b8d876..ddba1db2ef 100644 --- a/merge-ort.c +++ b/merge-ort.c @@ -3270,7 +3270,7 @@ static void process_entry(struct merge_options *opt, * above. */ if (ci->match_mask) { - ci->merged.clean = 1; + ci->merged.clean = !ci->df_conflict && !ci->path_conflict; if (ci->match_mask == 6) { /* stages[1] == stages[2] */ ci->merged.result.mode = ci->stages[1].mode; @@ -3282,6 +3282,8 @@ static void process_entry(struct merge_options *opt, ci->merged.result.mode = ci->stages[side].mode; ci->merged.is_null = !ci->merged.result.mode; + if (ci->merged.is_null) + ci->merged.clean = 1; oidcpy(&ci->merged.result.oid, &ci->stages[side].oid); assert(othermask == 2 || othermask == 4); @@ -3454,6 +3456,7 @@ static void process_entry(struct merge_options *opt, path)) { ci->merged.is_null = 1; ci->merged.clean = 1; + assert(!ci->df_conflict && !ci->path_conflict); } else if (ci->path_conflict && oideq(&ci->stages[0].oid, &ci->stages[side].oid)) { /* @@ -3480,6 +3483,7 @@ static void process_entry(struct merge_options *opt, ci->merged.is_null = 1; ci->merged.result.mode = 0; oidcpy(&ci->merged.result.oid, null_oid()); + assert(!ci->df_conflict); ci->merged.clean = !ci->path_conflict; } |