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

Function gf_batch_publish

src/mcp/test_impact_git.c:2007–2032  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2005}
2006
2007static bool gf_batch_publish(gf_batch_work_t *work, cbm_git_blob_batch_t *out,
2008 cbm_git_facts_error_t *error) {
2009 size_t count = work->request->count;
2010 cbm_git_blob_batch_item_t *items = NULL;
2011 if (count) {
2012 items = gf_batch_array(work->facts, count, sizeof(*items), error);
2013 if (!items)
2014 return false;
2015 for (size_t i = 0; i < count; i++) {
2016 if (!gf_gate(work->facts, error))
2017 return false;
2018 const gf_batch_pick_t *pick = &work->picks[i];
2019 items[pick->position] =
2020 (cbm_git_blob_batch_item_t){.inventory_index = pick->inventory_index,
2021 .entry = pick->entry,
2022 .bytes = work->objects[pick->object_index].bytes};
2023 }
2024 }
2025 if (!gf_history_guard(work->facts, error) || !gf_gate(work->facts, error))
2026 return false;
2027 *out = (cbm_git_blob_batch_t){.revision = work->request->revision,
2028 .commit = gf_revision(work->facts, work->request->revision),
2029 .items = items,
2030 .count = count};
2031 return true;
2032}
2033
2034static bool gf_batch_execute(cbm_git_facts_t *facts, const cbm_git_blob_batch_request_t *request,
2035 const cbm_git_blob_batch_limits_t *limits, cbm_git_blob_batch_t *out,

Callers 1

gf_batch_executeFunction · 0.85

Calls 4

gf_batch_arrayFunction · 0.85
gf_gateFunction · 0.85
gf_history_guardFunction · 0.85
gf_revisionFunction · 0.85

Tested by

no test coverage detected