merge-recursive: handle D/F conflict case more carefully.
[gitweb.git] / builtin-rm.c
index bf42003a7e79f96bf4964b116ddd3ee79350e682..8a0738f83dd31a847bf486ddb3aefef94af5e049 100644 (file)
@@ -110,7 +110,7 @@ int cmd_rm(int argc, const char **argv, const char *prefix)
 
        git_config(git_default_config);
 
-       newfd = hold_lock_file_for_update(&lock_file, get_index_file(), 1);
+       newfd = hold_locked_index(&lock_file, 1);
 
        if (read_cache() < 0)
                die("index file corrupt");
@@ -220,7 +220,7 @@ int cmd_rm(int argc, const char **argv, const char *prefix)
 
        if (active_cache_changed) {
                if (write_cache(newfd, active_cache, active_nr) ||
-                   close(newfd) || commit_lock_file(&lock_file))
+                   close(newfd) || commit_locked_index(&lock_file))
                        die("Unable to write new index file");
        }