| 98 | const char *name); |
| 99 | |
| 100 | static void process_tree_contents(struct traversal_context *ctx, |
| 101 | struct tree *tree, |
| 102 | struct strbuf *base) |
| 103 | { |
| 104 | struct tree_desc desc; |
| 105 | struct name_entry entry; |
| 106 | enum interesting match = ctx->revs->diffopt.pathspec.nr == 0 ? |
| 107 | all_entries_interesting : entry_not_interesting; |
| 108 | |
| 109 | init_tree_desc(&desc, &tree->object.oid, tree->buffer, tree->size); |
| 110 | |
| 111 | while (tree_entry(&desc, &entry)) { |
| 112 | if (match != all_entries_interesting) { |
| 113 | match = tree_entry_interesting(ctx->revs->repo->index, |
| 114 | &entry, base, |
| 115 | &ctx->revs->diffopt.pathspec); |
| 116 | if (match == all_entries_not_interesting) |
| 117 | break; |
| 118 | if (match == entry_not_interesting) |
| 119 | continue; |
| 120 | } |
| 121 | |
| 122 | if (S_ISDIR(entry.mode)) { |
| 123 | struct tree *t = lookup_tree(ctx->revs->repo, &entry.oid); |
| 124 | if (!t) { |
| 125 | die(_("entry '%s' in tree %s has tree mode, " |
| 126 | "but is not a tree"), |
| 127 | entry.path, oid_to_hex(&tree->object.oid)); |
| 128 | } |
| 129 | t->object.flags |= NOT_USER_GIVEN; |
| 130 | ctx->depth++; |
| 131 | process_tree(ctx, t, base, entry.path); |
| 132 | ctx->depth--; |
| 133 | } |
| 134 | else if (S_ISGITLINK(entry.mode)) |
| 135 | ; /* ignore gitlink */ |
| 136 | else { |
| 137 | struct blob *b = lookup_blob(ctx->revs->repo, &entry.oid); |
| 138 | if (!b) { |
| 139 | die(_("entry '%s' in tree %s has blob mode, " |
| 140 | "but is not a blob"), |
| 141 | entry.path, oid_to_hex(&tree->object.oid)); |
| 142 | } |
| 143 | b->object.flags |= NOT_USER_GIVEN; |
| 144 | process_blob(ctx, b, base, entry.path); |
| 145 | } |
| 146 | } |
| 147 | } |
| 148 | |
| 149 | static void process_tree(struct traversal_context *ctx, |
| 150 | struct tree *tree, |
no test coverage detected