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

Function gf_batch_payload

src/mcp/test_impact_git.c:1690–1709  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1688}
1689
1690static bool gf_batch_payload(cbm_git_facts_t *facts, cbm_git_bytes_t capture, size_t *offset,
1691 size_t size, cbm_git_bytes_t *bytes, cbm_git_facts_error_t *error) {
1692 if (size >= capture.length - *offset)
1693 return gf_error(error, CBM_GIT_FACTS_COMMAND, "Truncated Git batch payload");
1694 size_t start = *offset;
1695 for (size_t left = size; left;) {
1696 if (!gf_batch_gate(facts, error))
1697 return false;
1698 size_t chunk = left > 65536 ? 65536 : left;
1699 *offset += chunk;
1700 left -= chunk;
1701 }
1702 if (!gf_batch_gate(facts, error))
1703 return false;
1704 if (capture.data[*offset] != '\n')
1705 return gf_error(error, CBM_GIT_FACTS_COMMAND, "Malformed Git batch payload separator");
1706 (*offset)++;
1707 *bytes = (cbm_git_bytes_t){capture.data + start, size};
1708 return true;
1709}
1710
1711/* One exact capture driver for production and deterministic parser tests. */
1712static bool gf_batch_capture(cbm_git_facts_t *facts, cbm_git_bytes_t capture,

Callers 1

gf_batch_captureFunction · 0.85

Calls 2

gf_errorFunction · 0.85
gf_batch_gateFunction · 0.85

Tested by

no test coverage detected