diff options
-rw-r--r-- | merge-recursive.c | 2 | ||||
-rwxr-xr-x | t/t6036-recursive-corner-cases.sh | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/merge-recursive.c b/merge-recursive.c index e6a6a81ec2..418246376b 100644 --- a/merge-recursive.c +++ b/merge-recursive.c @@ -1466,6 +1466,8 @@ static int process_df_entry(struct merge_options *o, "Adding %s as %s", conf, path, other_branch, path, new_path); update_file(o, 0, sha, mode, new_path); + if (o->call_depth) + remove_file_from_cache(path); free(new_path); } else { output(o, 2, "Adding %s", path); diff --git a/t/t6036-recursive-corner-cases.sh b/t/t6036-recursive-corner-cases.sh index 526a2ea03b..ed6c6f45d6 100755 --- a/t/t6036-recursive-corner-cases.sh +++ b/t/t6036-recursive-corner-cases.sh @@ -509,7 +509,7 @@ test_expect_failure 'merge of D & E1 fails but has appropriate contents' ' test $(git rev-parse :2:a) = $(git rev-parse B:a) ' -test_expect_failure 'merge of E1 & D fails but has appropriate contents' ' +test_expect_success 'merge of E1 & D fails but has appropriate contents' ' get_clean_checkout E1^0 && test_must_fail git merge -s recursive D^0 && @@ -539,7 +539,7 @@ test_expect_success 'merge of D & E2 fails but has appropriate contents' ' test -f a~HEAD ' -test_expect_failure 'merge of E2 & D fails but has appropriate contents' ' +test_expect_success 'merge of E2 & D fails but has appropriate contents' ' get_clean_checkout E2^0 && test_must_fail git merge -s recursive D^0 && |