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

Function tpt_batch

src/mcp/test_impact_tree_batch.c:22–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20}
21
22bool tpt_batch(tpt_context *c, const cbm_pinned_tree_options_t *o, cbm_git_blob_batch_t *out) {
23 cbm_pinned_tree_t *t = c->tree;
24 cbm_git_blob_batch_request_t request = {o->revision, t->indices, t->view.file_count};
25 if (!tpt_poll(c))
26 return false;
27 cbm_git_facts_error_t error = {0};
28 bool ok = cbm_git_facts_read_blob_batch(o->facts, &request, &o->limits.blob_batch, out, &error);
29 if (!tpt_after_facts(c, ok, &error))
30 return false;
31 if (out->revision != o->revision || out->count != t->view.file_count ||
32 (out->count && !out->items) || (!out->count && out->items) ||
33 out->count > SIZE_MAX / sizeof(*out->items) ||
34 !tpt_oid(c, out->commit, t->identity.oid_hex_length) ||
35 !tpt_equal(c, out->commit, t->view.commit, t->identity.oid_hex_length + 1))
36 return tpt_fail(c, CBM_PINNED_TREE_GIT, "batch revision correspondence");
37 for (size_t i = 0; i < out->count; i++) {
38 if (!tpt_poll(c) || !tpt_batch_row(c, &out->items[i], i))
39 return false;
40 }
41 return true;
42}

Callers 1

tpt_loadFunction · 0.85

Calls 7

tpt_pollFunction · 0.85
tpt_after_factsFunction · 0.85
tpt_oidFunction · 0.85
tpt_equalFunction · 0.85
tpt_failFunction · 0.85
tpt_batch_rowFunction · 0.85

Tested by

no test coverage detected