git-rerere: detect unparsable conflicts
[gitweb.git] / builtin-rerere.c
index 610b96a1202cdbf17c1b930d8b432e2262f5ffd3..addc5c73df0fd909d6e8e3aa799b73028819f0b7 100644 (file)
@@ -144,6 +144,11 @@ static int handle_file(const char *path,
                fclose(out);
        if (sha1)
                SHA1_Final(sha1, &ctx);
+       if (hunk) {
+               if (output)
+                       unlink(output);
+               return error("Could not parse conflict hunks in %s", path);
+       }
        return hunk_no;
 }