MCPcopy Index your code
hub / github.com/git/git / process_tree

Function process_tree

walker.c:43–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41static int process(struct walker *walker, struct object *obj);
42
43static int process_tree(struct walker *walker, struct tree *tree)
44{
45 struct tree_desc desc;
46 struct name_entry entry;
47
48 if (repo_parse_tree(the_repository, tree))
49 return -1;
50
51 init_tree_desc(&desc, &tree->object.oid, tree->buffer, tree->size);
52 while (tree_entry(&desc, &entry)) {
53 struct object *obj = NULL;
54
55 /* submodule commits are not stored in the superproject */
56 if (S_ISGITLINK(entry.mode))
57 continue;
58 if (S_ISDIR(entry.mode)) {
59 struct tree *tree = lookup_tree(the_repository,
60 &entry.oid);
61 if (tree)
62 obj = &tree->object;
63 }
64 else {
65 struct blob *blob = lookup_blob(the_repository,
66 &entry.oid);
67 if (blob)
68 obj = &blob->object;
69 }
70 if (!obj || process(walker, obj))
71 return -1;
72 }
73 free_tree_buffer(tree);
74 return 0;
75}
76
77/* Remember to update object flag allocation in object.h */
78#define COMPLETE (1U << 0)

Callers 1

process_objectFunction · 0.70

Calls 7

repo_parse_treeFunction · 0.85
init_tree_descFunction · 0.85
lookup_treeFunction · 0.85
lookup_blobFunction · 0.85
processFunction · 0.85
free_tree_bufferFunction · 0.85
tree_entryFunction · 0.70

Tested by

no test coverage detected