Code

Improve use of lockfile API
[git.git] / builtin-rerere.c
index 37e62481388aecc8ffb9b5943de248f496ca9d13..a9e3ebc13725cbe8658478797d6e1d8e097e5292 100644 (file)
@@ -61,9 +61,9 @@ static int write_rr(struct path_list *rr, int out_fd)
                    write_in_full(out_fd, path, length) != length)
                        die("unable to write rerere record");
        }
-       if (close(out_fd) != 0)
+       if (commit_lock_file(&write_lock) != 0)
                die("unable to write rerere record");
-       return commit_lock_file(&write_lock);
+       return 0;
 }
 
 static int handle_file(const char *path,