Code

glossary: Add definitions for dangling and unreachable objects
[git.git] / merge-recursive.c
index a5e68457f45f24a646d22eba5f3e3ed9a46286d0..397a7ad85b4968b9376438f12d0c3c70b7aed880 100644 (file)
@@ -589,7 +589,7 @@ static void update_file_flags(const unsigned char *sha,
                        memcpy(lnk, buf, size);
                        lnk[size] = '\0';
                        mkdir_p(path, 0777);
-                       unlink(lnk);
+                       unlink(path);
                        symlink(lnk, path);
                } else
                        die("do not know what to do with %06o %s '%s'",
@@ -891,7 +891,7 @@ static int process_renames(struct path_list *a_renames,
                        struct diff_filespec src_other, dst_other;
                        int try_merge, stage = a_renames == renames1 ? 3: 2;
 
-                       remove_file(1, ren1_src, index_only);
+                       remove_file(1, ren1_src, index_only || stage == 3);
 
                        hashcpy(src_other.sha1, ren1->src_entry->stages[stage].sha);
                        src_other.mode = ren1->src_entry->stages[stage].mode;
@@ -1213,7 +1213,7 @@ static int merge(struct commit *h1,
 
                tree->object.parsed = 1;
                tree->object.type = OBJ_TREE;
-               write_sha1_file(NULL, 0, tree_type, tree->object.sha1);
+               pretend_sha1_file(NULL, 0, tree_type, tree->object.sha1);
                merged_common_ancestors = make_virtual_commit(tree, "ancestor");
        }