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

Function gf_batch_inventory

src/mcp/test_impact_git.c:1802–1821  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1800}
1801
1802static bool gf_batch_inventory(gf_batch_work_t *work, cbm_git_facts_error_t *error) {
1803 cbm_git_facts_t *facts = work->facts;
1804 const char *commit = gf_revision(facts, work->request->revision);
1805 for (size_t i = 0; i < 2; i++) {
1806 if (facts->inventory_cache[i].commit &&
1807 strcmp(facts->inventory_cache[i].commit, commit) == 0) {
1808 work->inventory = facts->inventory_cache[i].inventory;
1809 return gf_gate(facts, error);
1810 }
1811 }
1812 if (!cbm_git_facts_inventory(facts, work->request->revision, &work->inventory, error))
1813 return false;
1814 for (size_t i = 0; i < 2; i++) {
1815 if (!facts->inventory_cache[i].commit) {
1816 facts->inventory_cache[i] = (gf_inventory_cache_t){commit, work->inventory};
1817 return true;
1818 }
1819 }
1820 return gf_error(error, CBM_GIT_FACTS_INVALID, "Invalid internal pinned inventory cache");
1821}
1822
1823static int gf_batch_pick_compare(const gf_batch_pick_t *a, const gf_batch_pick_t *b, size_t width) {
1824 int cmp = memcmp(a->entry->oid, b->entry->oid, width);

Callers 1

gf_batch_executeFunction · 0.85

Calls 4

gf_revisionFunction · 0.85
gf_gateFunction · 0.85
cbm_git_facts_inventoryFunction · 0.85
gf_errorFunction · 0.85

Tested by

no test coverage detected