Skip to content

Commit 2b80531

Browse files
committed
Merge branch 'cherry-pick-segfault'
This branch fixes the problem where merge-recursive's add_cacheinfo() expected refresh_cache_entry() always to return a valid cache entry (but it does not do that e.g. when the file in the worktree is modified). Signed-off-by: Johannes Schindelin <[email protected]>
2 parents 6584578 + 1ed2ac6 commit 2b80531

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

merge-recursive.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,9 +235,7 @@ static int add_cacheinfo(struct merge_options *o,
235235
struct cache_entry *nce;
236236

237237
nce = refresh_cache_entry(ce, CE_MATCH_REFRESH | CE_MATCH_IGNORE_MISSING);
238-
if (!nce)
239-
return err(o, _("addinfo_cache failed for path '%s'"), path);
240-
if (nce != ce)
238+
if (nce && nce != ce)
241239
ret = add_cache_entry(nce, options);
242240
}
243241
return ret;

0 commit comments

Comments
 (0)