t3418: non-interactive rebase --continue with rerere enabled
[gitweb.git] / commit.c
index 2d9de807aeb230c97e74928c1b446544186bc4e1..6e2103cef60e8a0c2df18685280dbb5fda5c133f 100644 (file)
--- a/commit.c
+++ b/commit.c
@@ -357,7 +357,7 @@ int parse_commit_buffer(struct commit *item, const void *buffer, unsigned long s
        return 0;
 }
 
-int parse_commit(struct commit *item)
+int parse_commit_gently(struct commit *item, int quiet_on_missing)
 {
        enum object_type type;
        void *buffer;
@@ -370,7 +370,8 @@ int parse_commit(struct commit *item)
                return 0;
        buffer = read_sha1_file(item->object.sha1, &type, &size);
        if (!buffer)
-               return error("Could not read %s",
+               return quiet_on_missing ? -1 :
+                       error("Could not read %s",
                             sha1_to_hex(item->object.sha1));
        if (type != OBJ_COMMIT) {
                free(buffer);