MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / tpt_load

Function tpt_load

src/mcp/test_impact_tree.c:66–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64}
65
66static bool tpt_load(tpt_context *c, const cbm_pinned_tree_options_t *o) {
67 if (!tpt_identity_copy(c, o) || !tpt_poll(c))
68 return false;
69 cbm_git_tree_inventory_t inventory = {0};
70 cbm_git_tree_inventory_t regular = {0};
71 size_t *original = NULL;
72 cbm_git_facts_error_t error = {0};
73 bool ok = cbm_git_facts_inventory(o->facts, o->revision, &inventory, &error);
74 if (!tpt_after_facts(c, ok, &error) || !tpt_without_links(c, &inventory, &regular, &original) ||
75 !tpt_plan(c, o, &regular))
76 return false;
77 /* The plan numbered the kept entries; the blob batch names positions in
78 * the facts' own inventory. */
79 for (size_t i = 0; original && i < c->tree->view.file_count; i++)
80 c->tree->indices[i] = original[c->tree->indices[i]];
81 cbm_git_blob_batch_t batch = {0};
82 return tpt_batch(c, o, &batch) && tpt_native_prepare(c) && tpt_build(c, &batch) &&
83 tpt_audit(c) && tpt_manifest(c) && tpt_poll(c);
84}
85
86static void tpt_cleanup_error(tpt_context *c, const cbm_pinned_tree_error_t *primary) {
87 cbm_pinned_tree_error_t cleanup = c->error;

Callers 1

cbm_pinned_tree_createFunction · 0.85

Calls 11

tpt_identity_copyFunction · 0.85
tpt_pollFunction · 0.85
cbm_git_facts_inventoryFunction · 0.85
tpt_after_factsFunction · 0.85
tpt_without_linksFunction · 0.85
tpt_planFunction · 0.85
tpt_batchFunction · 0.85
tpt_buildFunction · 0.85
tpt_auditFunction · 0.85
tpt_manifestFunction · 0.85
tpt_native_prepareFunction · 0.70

Tested by

no test coverage detected