diff options
-rw-r--r-- | merge-recursive.c | 3 | ||||
-rwxr-xr-x | t/t6042-merge-rename-corner-cases.sh | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/merge-recursive.c b/merge-recursive.c index ce57ea530b..089cfe88c1 100644 --- a/merge-recursive.c +++ b/merge-recursive.c @@ -1115,7 +1115,8 @@ static int process_renames(struct merge_options *o, int renamed_stage = a_renames == renames1 ? 2 : 3; int other_stage = a_renames == renames1 ? 3 : 2; - remove_file(o, 1, ren1_src, o->call_depth || renamed_stage == 2); + remove_file(o, 1, ren1_src, + renamed_stage == 2 || !was_tracked(ren1_src)); hashcpy(src_other.sha1, ren1->src_entry->stages[other_stage].sha); src_other.mode = ren1->src_entry->stages[other_stage].mode; diff --git a/t/t6042-merge-rename-corner-cases.sh b/t/t6042-merge-rename-corner-cases.sh index 427fe1c913..668ec6d498 100755 --- a/t/t6042-merge-rename-corner-cases.sh +++ b/t/t6042-merge-rename-corner-cases.sh @@ -26,7 +26,7 @@ test_expect_success 'setup rename/delete + untracked file' ' echo "Myyy PRECIOUSSS" >ring ' -test_expect_failure "Does git preserve Gollum's precious artifact?" ' +test_expect_success "Does git preserve Gollum's precious artifact?" ' test_must_fail git merge -s recursive rename-the-ring && # Make sure git did not delete an untracked file |