GIT_TRACE: fix a mixed declarations and code warning
[gitweb.git] / builtin-read-tree.c
index 9a2099d7307903d62c85f3483a22969ab5094c84..23a8d92a4b77e7436069c976bc5fa0ec162a9324 100644 (file)
@@ -1038,7 +1038,7 @@ int cmd_read_tree(int argc, const char **argv, char **envp)
        }
 
        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");
        return 0;
 }