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

Function process_blob

list-objects.c:51–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49}
50
51static void process_blob(struct traversal_context *ctx,
52 struct blob *blob,
53 struct strbuf *path,
54 const char *name)
55{
56 struct object *obj = &blob->object;
57 size_t pathlen;
58 enum list_objects_filter_result r;
59
60 if (!ctx->revs->blob_objects)
61 return;
62 if (!obj)
63 die("bad blob object");
64 if (obj->flags & (UNINTERESTING | SEEN))
65 return;
66
67 /*
68 * Pre-filter known-missing objects when explicitly requested.
69 * Otherwise, a missing object error message may be reported
70 * later (depending on other filtering criteria).
71 *
72 * Note that this "--exclude-promisor-objects" pre-filtering
73 * may cause the actual filter to report an incomplete list
74 * of missing objects.
75 */
76 if (ctx->revs->exclude_promisor_objects &&
77 !odb_has_object(the_repository->objects, &obj->oid,
78 ODB_HAS_OBJECT_RECHECK_PACKED | ODB_HAS_OBJECT_FETCH_PROMISOR) &&
79 is_promisor_object(ctx->revs->repo, &obj->oid))
80 return;
81
82 pathlen = path->len;
83 strbuf_addstr(path, name);
84 r = list_objects_filter__filter_object(ctx->revs->repo,
85 LOFS_BLOB, obj,
86 path->buf, &path->buf[pathlen],
87 ctx->filter);
88 if (r & LOFR_MARK_SEEN)
89 obj->flags |= SEEN;
90 if (r & LOFR_DO_SHOW)
91 show_object(ctx, obj, path->buf);
92 strbuf_setlen(path, pathlen);
93}
94
95static void process_tree(struct traversal_context *ctx,
96 struct tree *tree,

Callers 2

process_tree_contentsFunction · 0.70
traverse_non_commitsFunction · 0.70

Calls 7

odb_has_objectFunction · 0.85
is_promisor_objectFunction · 0.85
strbuf_addstrFunction · 0.85
strbuf_setlenFunction · 0.85
dieFunction · 0.70
show_objectFunction · 0.70

Tested by

no test coverage detected