summaryrefslogtreecommitdiff
path: root/fetch.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <junkio@cox.net>2006-05-28 23:05:02 -0700
committerLibravatar Junio C Hamano <junkio@cox.net>2006-05-28 23:05:02 -0700
commit52bc0e294c0d5924db0e5e8f25284e467c6d2983 (patch)
tree86f9e8fe89841de0e69e91902865002dffdaa6bf /fetch.c
parentMerge branch 'jc/cache-tree' into next (diff)
parentMerge branch 'lt/tree' into jc/lt-tree-n-cache-tree (diff)
downloadtgif-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.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/fetch.c b/fetch.c
index ae92d5212e..ae65b42056 100644
--- a/fetch.c
+++ b/fetch.c
@@ -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;
}