merge-recursive: avoid triggering add_cacheinfo error with dirty mod
[gitweb.git] / merge-recursive.c
index bffcd5fa514d6555c0ff927bc0d5c47198d3f8de..804dfefd15d5800629f12146cbd7264b722c2169 100644 (file)
@@ -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;
                }