summaryrefslogtreecommitdiff
path: root/fetch.c
diff options
context:
space:
mode:
Diffstat (limited to 'fetch.c')
-rw-r--r--fetch.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/fetch.c b/fetch.c
index ec2d8c3d9b..107504b72b 100644
--- a/fetch.c
+++ b/fetch.c
@@ -46,13 +46,20 @@ static int process_tree(struct tree *tree)
desc.buf = tree->buffer;
desc.size = tree->size;
while (tree_entry(&desc, &entry)) {
+ struct object *obj = NULL;
+
if (S_ISDIR(entry.mode)) {
struct tree *tree = lookup_tree(entry.sha1);
- process_tree(tree);
- } else {
+ if (tree)
+ obj = &tree->object;
+ }
+ else {
struct blob *blob = lookup_blob(entry.sha1);
- process(&blob->object);
+ if (blob)
+ obj = &blob->object;
}
+ if (!obj || process(obj))
+ return -1;
}
free(tree->buffer);
tree->buffer = NULL;