merge-recursive: avoid triggering add_cacheinfo error with dirty mod
If a cherry-pick or merge with a rename results in a skippable update (due to the merged content matching what HEAD already had), but the working directory is dirty, avoid trying to refresh the index as that will fail. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
bd42380ef1
commit
2f682e21a6
@ -2786,7 +2786,7 @@ static int merge_content(struct merge_options *o,
|
||||
path_renamed_outside_HEAD = !path2 || !strcmp(path, path2);
|
||||
if (!path_renamed_outside_HEAD) {
|
||||
if (add_cacheinfo(o, mfi.mode, &mfi.oid, path,
|
||||
0, (!o->call_depth), 0))
|
||||
0, (!o->call_depth && !is_dirty), 0))
|
||||
return -1;
|
||||
return mfi.clean;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user