summaryrefslogtreecommitdiff
path: root/merge-recursive.c
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-01-27 09:45:09 -0500
committerJunio C Hamano <gitster@pobox.com>2014-02-24 14:31:30 -0800
commit6e2068ae48000a2dfdb2044bbb91073c11f6fbff (patch)
treee5af6529e9e806d99ff89d41f1682c921cb345b6 /merge-recursive.c
parent257627268ad19cb616ad3feb6ca8171d400df287 (diff)
downloadgit-6e2068ae48000a2dfdb2044bbb91073c11f6fbff.tar.gz
merge-recursive.c: tolerate missing files while refreshing indexbk/refresh-missing-ok-in-merge-recursive
Teach add_cacheinfo to tell make_cache_entry to skip refreshing stat information when a file is missing from the work tree. We do not want the index to be stat-dirty after the merge but also do not want to fail when a file happens to be missing. This fixes the 'merge-recursive w/ empty work tree - ours has rename' case in t3030-merge-recursive. Suggested-by: Elijah Newren <newren@gmail.com> Signed-off-by: Brad King <brad.king@kitware.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'merge-recursive.c')
-rw-r--r--merge-recursive.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/merge-recursive.c b/merge-recursive.c
index 05311e411c..786dee7596 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -202,7 +202,8 @@ static int add_cacheinfo(unsigned int mode, const unsigned char *sha1,
{
struct cache_entry *ce;
ce = make_cache_entry(mode, sha1 ? sha1 : null_sha1, path, stage,
- (refresh ? CE_MATCH_REFRESH : 0 ));
+ (refresh ? (CE_MATCH_REFRESH |
+ CE_MATCH_IGNORE_MISSING) : 0 ));
if (!ce)
return error(_("addinfo_cache failed for path '%s'"), path);
return add_cache_entry(ce, options);