change ent to tree in git-diff documentation
[gitweb.git] / builtin-rm.c
index 4d56a1f07065e6e8ebaa95fdfe843cffb6283af3..875d8252fa72cf7adc1d6bb254ebc3a5995e49dd 100644 (file)
@@ -147,7 +147,7 @@ int cmd_rm(int argc, const char **argv, char **envp)
 
        if (active_cache_changed) {
                if (write_cache(newfd, active_cache, active_nr) ||
-                   commit_lock_file(&lock_file))
+                   close(newfd) || commit_lock_file(&lock_file))
                        die("Unable to write new index file");
        }