diff options
author | Junio C Hamano <junkio@cox.net> | 2006-05-28 23:05:02 -0700 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-05-28 23:05:02 -0700 |
commit | 52bc0e294c0d5924db0e5e8f25284e467c6d2983 (patch) | |
tree | 86f9e8fe89841de0e69e91902865002dffdaa6bf /fetch.c | |
parent | Merge branch 'jc/cache-tree' into next (diff) | |
parent | Merge branch 'lt/tree' into jc/lt-tree-n-cache-tree (diff) | |
download | tgif-52bc0e294c0d5924db0e5e8f25284e467c6d2983.tar.xz |
Merge branch 'jc/lt-tree-n-cache-tree' into next
* jc/lt-tree-n-cache-tree:
Remove "tree->entries" tree-entry list from tree parser
Switch "read_tree_recursive()" over to tree-walk functionality
Make "tree_entry" have a SHA1 instead of a union of object pointers
Add raw tree buffer info to "struct tree"
Don't use "sscanf()" for tree mode scanning
git-fetch: avoid using "case ... in (arm)"
Diffstat (limited to 'fetch.c')
-rw-r--r-- | fetch.c | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -42,16 +42,22 @@ static int process_tree(struct tree *tree) if (parse_tree(tree)) return -1; - entry = tree->entries; - tree->entries = NULL; + entry = create_tree_entry_list(tree); while (entry) { struct tree_entry_list *next = entry->next; - if (process(entry->item.any)) - return -1; - free(entry->name); + + if (entry->directory) { + struct tree *tree = lookup_tree(entry->sha1); + process_tree(tree); + } else { + struct blob *blob = lookup_blob(entry->sha1); + process(&blob->object); + } free(entry); entry = next; } + free(tree->buffer); + tree->buffer = NULL; return 0; } |