diff options
author | Junio C Hamano <junkio@cox.net> | 2006-06-02 15:24:07 -0700 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-06-02 15:24:07 -0700 |
commit | 0fa5cb0d1e13bf757b41b0b0665305b7c819ee60 (patch) | |
tree | 04c0a0de08d83ce0c9929107659c97194b61bc24 /fetch.c | |
parent | Merge branch 'jc/fmt-patch' into next (diff) | |
parent | fetch.c: do not call process_tree() from process_tree(). (diff) | |
download | tgif-0fa5cb0d1e13bf757b41b0b0665305b7c819ee60.tar.xz |
Merge branch 'lt/tree-2' into next
* lt/tree-2:
fetch.c: do not call process_tree() from process_tree().
Diffstat (limited to 'fetch.c')
-rw-r--r-- | fetch.c | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -47,13 +47,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; |