builtin/reset: convert use of EMPTY_TREE_SHA1_BIN
[gitweb.git] / builtin / mv.c
index e3e308d282f45ac0e8e68be6732043f0cd039d96..6d141f7a532c08e52f1f5f82330d046c60073f93 100644 (file)
@@ -287,15 +287,14 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
 
                pos = cache_name_pos(src, strlen(src));
                assert(pos >= 0);
-               if (!show_only)
-                       rename_cache_entry_at(pos, dst);
+               rename_cache_entry_at(pos, dst);
        }
 
        if (gitmodules_modified)
                stage_updated_gitmodules(&the_index);
 
-       if (active_cache_changed &&
-           write_locked_index(&the_index, &lock_file, COMMIT_LOCK))
+       if (write_locked_index(&the_index, &lock_file,
+                              COMMIT_LOCK | SKIP_IF_UNCHANGED))
                die(_("Unable to write new index file"));
 
        return 0;