projects
/
git.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'lt/tree-2' into next
[git.git]
/
fetch.c
diff --git
a/fetch.c
b/fetch.c
index
1291bba
..
e040ef9
100644
(file)
--- a/
fetch.c
+++ b/
fetch.c
@@
-47,13
+47,20
@@
static int process_tree(struct tree *tree)
desc.buf = tree->buffer;
desc.size = tree->size;
while (tree_entry(&desc, &entry)) {
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);
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);
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;
}
free(tree->buffer);
tree->buffer = NULL;