Additional merge-base tests (revised)
[gitweb.git] / checkout-index.c
index ea40bc29bed17fbd6e3326edaa6fb3c38b742de6..29279555086ce36cdf598e390898a46888543846 100644 (file)
@@ -311,7 +311,7 @@ int main(int argc, char **argv)
 
        if (0 <= newfd &&
            (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;
 }