diff --git a/merge-recursive.c b/merge-recursive.c index 9041c2f149..5dc7587cd3 100644 --- a/merge-recursive.c +++ b/merge-recursive.c @@ -235,7 +235,7 @@ static int add_cacheinfo(struct merge_options *o, struct cache_entry *nce; nce = refresh_cache_entry(ce, CE_MATCH_REFRESH | CE_MATCH_IGNORE_MISSING); - if (nce != ce) + if (nce && nce != ce) ret = add_cache_entry(nce, options); } return ret; diff --git a/t/t3501-revert-cherry-pick.sh b/t/t3501-revert-cherry-pick.sh index d7b4251234..4f2a263b63 100755 --- a/t/t3501-revert-cherry-pick.sh +++ b/t/t3501-revert-cherry-pick.sh @@ -141,7 +141,7 @@ test_expect_success 'cherry-pick "-" works with arguments' ' test_cmp expect actual ' -test_expect_failure 'cherry-pick works with dirty renamed file' ' +test_expect_success 'cherry-pick works with dirty renamed file' ' test_commit to-rename && git checkout -b unrelated && test_commit unrelated &&