Merge branch 'jk/shell-no-repository-that-begins-with-dash' into maint-2.4
[gitweb.git] / tree.c
diff --git a/tree.c b/tree.c
index 58ebfce1bca609b0f7119eb210345c2065d02f40..413a5b1fa617df2f407d32ffdf78e58d9c42de58 100644 (file)
--- a/tree.c
+++ b/tree.c
@@ -204,7 +204,7 @@ int parse_tree_buffer(struct tree *item, void *buffer, unsigned long size)
        return 0;
 }
 
-int parse_tree(struct tree *item)
+int parse_tree_gently(struct tree *item, int quiet_on_missing)
 {
         enum object_type type;
         void *buffer;
@@ -214,7 +214,8 @@ int parse_tree(struct tree *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_TREE) {
                free(buffer);