]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/rm.c
write_locked_index(): add flag to avoid writing unchanged index
[thirdparty/git.git] / builtin / rm.c
index 4a2fcca27b3f722ca520c2411b80e6984ecf780a..5d59a0aa65729a5d5c8e3c3c13ab743ce7b064b3 100644 (file)
@@ -385,10 +385,9 @@ int cmd_rm(int argc, const char **argv, const char *prefix)
                        stage_updated_gitmodules(&the_index);
        }
 
-       if (active_cache_changed) {
-               if (write_locked_index(&the_index, &lock_file, COMMIT_LOCK))
-                       die(_("Unable to write new index file"));
-       }
+       if (write_locked_index(&the_index, &lock_file,
+                              COMMIT_LOCK | SKIP_IF_UNCHANGED))
+               die(_("Unable to write new index file"));
 
        return 0;
 }