merge-recursive: mark rename/delete conflict as unmerged
[gitweb.git] / merge-recursive.c
index 0e988f2a0081803f5ee30adbf7a548c2c8a00a05..69e71522048a3eeb70a093ae3c17a225168e932b 100644 (file)
@@ -525,7 +525,8 @@ static void update_file_flags(struct merge_options *o,
                        char *lnk = xmemdupz(buf, size);
                        safe_create_leading_directories_const(path);
                        unlink(path);
-                       symlink(lnk, path);
+                       if (symlink(lnk, path))
+                               die("failed to symlink %s: %s", path, strerror(errno));
                        free(lnk);
                } else
                        die("do not know what to do with %06o %s '%s'",
@@ -901,6 +902,11 @@ static int process_renames(struct merge_options *o,
                                       ren1_src, ren1_dst, branch1,
                                       branch2);
                                update_file(o, 0, ren1->pair->two->sha1, ren1->pair->two->mode, ren1_dst);
+                               update_stages(ren1_dst, NULL,
+                                               branch1 == o->branch1 ?
+                                               ren1->pair->two : NULL,
+                                               branch1 == o->branch1 ?
+                                               NULL : ren1->pair->two, 1);
                        } else if (!sha_eq(dst_other.sha1, null_sha1)) {
                                const char *new_path;
                                clean_merge = 0;