Merge branch 'jh/partial-clone'
[gitweb.git] / merge-recursive.c
index 129577987ba25402a6b9494b103a4643e2b37e68..869092f7b9bc0ce1104a1c43c7201acdee2eb4f8 100644 (file)
@@ -2090,7 +2090,7 @@ int merge_recursive(struct merge_options *o,
 {
        struct commit_list *iter;
        struct commit *merged_common_ancestors;
-       struct tree *mrtree = mrtree;
+       struct tree *mrtree;
        int clean;
 
        if (show(o, 4)) {
@@ -2223,10 +2223,9 @@ int merge_recursive_generic(struct merge_options *o,
                return clean;
        }
 
-       if (active_cache_changed &&
-           write_locked_index(&the_index, &lock, COMMIT_LOCK))
+       if (write_locked_index(&the_index, &lock,
+                              COMMIT_LOCK | SKIP_IF_UNCHANGED))
                return err(o, _("Unable to write index."));
-       rollback_lock_file(&lock);
 
        return clean ? 0 : 1;
 }