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

Function traverse_non_commits

list-objects.c:344–375  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

342}
343
344static void traverse_non_commits(struct traversal_context *ctx,
345 struct strbuf *base)
346{
347 assert(base->len == 0);
348
349 for (size_t i = 0; i < ctx->revs->pending.nr; i++) {
350 struct object_array_entry *pending = ctx->revs->pending.objects + i;
351 struct object *obj = pending->item;
352 const char *name = pending->name;
353 const char *path = pending->path;
354 if (obj->flags & (UNINTERESTING | SEEN))
355 continue;
356 if (obj->type == OBJ_TAG) {
357 process_tag(ctx, (struct tag *)obj, name);
358 continue;
359 }
360 if (!path)
361 path = "";
362 if (obj->type == OBJ_TREE) {
363 ctx->depth = 0;
364 process_tree(ctx, (struct tree *)obj, base, path);
365 continue;
366 }
367 if (obj->type == OBJ_BLOB) {
368 process_blob(ctx, (struct blob *)obj, base, path);
369 continue;
370 }
371 die("unknown pending object %s (%s)",
372 oid_to_hex(&obj->oid), name);
373 }
374 object_array_clear(&ctx->revs->pending);
375}
376
377static void do_traverse(struct traversal_context *ctx)
378{

Callers 1

do_traverseFunction · 0.85

Calls 6

oid_to_hexFunction · 0.85
object_array_clearFunction · 0.85
process_tagFunction · 0.70
process_treeFunction · 0.70
process_blobFunction · 0.70
dieFunction · 0.70

Tested by

no test coverage detected