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

Function do_traverse

list-objects.c:377–424  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

375}
376
377static void do_traverse(struct traversal_context *ctx)
378{
379 struct commit *commit;
380 struct strbuf csp; /* callee's scratch pad */
381 strbuf_init(&csp, PATH_MAX);
382
383 while ((commit = get_revision(ctx->revs)) != NULL) {
384 enum list_objects_filter_result r;
385
386 r = list_objects_filter__filter_object(ctx->revs->repo,
387 LOFS_COMMIT, &commit->object,
388 NULL, NULL, ctx->filter);
389
390 /*
391 * an uninteresting boundary commit may not have its tree
392 * parsed yet, but we are not going to show them anyway
393 */
394 if (!ctx->revs->tree_objects)
395 ; /* do not bother loading tree */
396 else if (ctx->revs->do_not_die_on_missing_objects &&
397 oidset_contains(&ctx->revs->missing_commits, &commit->object.oid))
398 ;
399 else if (repo_get_commit_tree(the_repository, commit)) {
400 struct tree *tree = repo_get_commit_tree(the_repository,
401 commit);
402 tree->object.flags |= NOT_USER_GIVEN;
403 add_pending_tree(ctx->revs, tree);
404 } else if (commit->object.parsed) {
405 die(_("unable to load root tree for commit %s"),
406 oid_to_hex(&commit->object.oid));
407 }
408
409 if (r & LOFR_MARK_SEEN)
410 commit->object.flags |= SEEN;
411 if (r & LOFR_DO_SHOW)
412 show_commit(ctx, commit);
413
414 if (ctx->revs->tree_blobs_in_commit_order)
415 /*
416 * NEEDSWORK: Adding the tree and then flushing it here
417 * needs a reallocation for each commit. Can we pass the
418 * tree directory without allocation churn?
419 */
420 traverse_non_commits(ctx, &csp);
421 }
422 traverse_non_commits(ctx, &csp);
423 strbuf_release(&csp);
424}
425
426void traverse_commit_list_filtered(
427 struct rev_info *revs,

Callers 1

Calls 11

strbuf_initFunction · 0.85
get_revisionFunction · 0.85
oidset_containsFunction · 0.85
repo_get_commit_treeFunction · 0.85
add_pending_treeFunction · 0.85
oid_to_hexFunction · 0.85
traverse_non_commitsFunction · 0.85
strbuf_releaseFunction · 0.85
dieFunction · 0.70
show_commitFunction · 0.70

Tested by

no test coverage detected