diff options
-rw-r--r-- | merge-ort.c | 6 | ||||
-rwxr-xr-x | t/t6423-merge-rename-directories.sh | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/merge-ort.c b/merge-ort.c index 4a9ce2a822..8b0f2448f0 100644 --- a/merge-ort.c +++ b/merge-ort.c @@ -3002,7 +3002,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; @@ -3014,6 +3014,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); @@ -3186,6 +3188,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)) { /* @@ -3212,6 +3215,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; } diff --git a/t/t6423-merge-rename-directories.sh b/t/t6423-merge-rename-directories.sh index afb88c347f..316339cb6c 100755 --- a/t/t6423-merge-rename-directories.sh +++ b/t/t6423-merge-rename-directories.sh @@ -5000,7 +5000,7 @@ test_setup_12i () { ) } -test_expect_merge_algorithm failure failure '12i: Directory rename causes rename-to-self' ' +test_expect_merge_algorithm failure success '12i: Directory rename causes rename-to-self' ' test_setup_12i && ( cd 12i && @@ -5058,7 +5058,7 @@ test_setup_12j () { ) } -test_expect_merge_algorithm failure failure '12j: Directory rename to root causes rename-to-self' ' +test_expect_merge_algorithm failure success '12j: Directory rename to root causes rename-to-self' ' test_setup_12j && ( cd 12j && @@ -5116,7 +5116,7 @@ test_setup_12k () { ) } -test_expect_merge_algorithm failure failure '12k: Directory rename with sibling causes rename-to-self' ' +test_expect_merge_algorithm failure success '12k: Directory rename with sibling causes rename-to-self' ' test_setup_12k && ( cd 12k && |