]> asedeno.scripts.mit.edu Git - git.git/blobdiff - builtin-mv.c
Make for-each-ref's grab_date() support per-atom formatting
[git.git] / builtin-mv.c
index c4ab4784cece771074c43580bf1874b92b11a249..b95b7d286ab5358a89a0309927b9f5e5e23fc4d0 100644 (file)
@@ -77,7 +77,7 @@ int cmd_mv(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");
 
@@ -276,16 +276,13 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
                        add_file_to_cache(path, verbose);
                }
 
-               for (i = 0; i < deleted.nr; i++) {
-                       const char *path = deleted.items[i].path;
-                       remove_file_from_cache(path);
-                       cache_tree_invalidate_path(active_cache_tree, path);
-               }
+               for (i = 0; i < deleted.nr; i++)
+                       remove_file_from_cache(deleted.items[i].path);
 
                if (active_cache_changed) {
                        if (write_cache(newfd, active_cache, active_nr) ||
                            close(newfd) ||
-                           commit_lock_file(&lock_file))
+                           commit_locked_index(&lock_file))
                                die("Unable to write new index file");
                }
        }