Merge branch 'jk/warn-add-gitlink'
[gitweb.git] / rerere.c
index 1351b0c3fbd47e9f6e913e586081a7317670f807..829b3b0f08f7546c168e2728687d5729c4607cfa 100644 (file)
--- a/rerere.c
+++ b/rerere.c
@@ -1,4 +1,5 @@
 #include "cache.h"
+#include "config.h"
 #include "lockfile.h"
 #include "string-list.h"
 #include "rerere.h"
@@ -489,8 +490,9 @@ static int handle_file(const char *path, unsigned char *sha1, const char *output
        if (output) {
                io.io.output = fopen(output, "w");
                if (!io.io.output) {
+                       error_errno("Could not write %s", output);
                        fclose(io.input);
-                       return error_errno("Could not write %s", output);
+                       return -1;
                }
        }