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

Function gfi_matches

tests/test_test_impact_git.c:1020–1037  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1018} gfi_expected_t;
1019
1020static bool gfi_matches(const cbm_git_tree_inventory_t *inventory,
1021 const gfi_expected_t *expected, size_t count) {
1022 if (inventory->count != count || (count && !inventory->entries))
1023 return false;
1024 if (!count)
1025 return inventory->entries == NULL;
1026 for (size_t i = 0; i < count; i++) {
1027 const cbm_git_tree_entry_t *entry = &inventory->entries[i];
1028 size_t oid_length = strlen(expected[i].oid);
1029 if (!entry->path || entry->path_length != expected[i].length ||
1030 memcmp(entry->path, expected[i].path, expected[i].length) != 0 ||
1031 entry->path[entry->path_length] != '\0' || entry->mode != expected[i].mode ||
1032 entry->object_type != expected[i].type || oid_length >= sizeof(entry->oid) ||
1033 entry->oid[oid_length] != '\0' || memcmp(entry->oid, expected[i].oid, oid_length) != 0)
1034 return false;
1035 }
1036 return true;
1037}
1038
1039static bool gfi_cleared(const cbm_git_tree_inventory_t *inventory) {
1040 return inventory->entries == NULL && inventory->count == 0;

Callers 2

gfb_inventory_controlFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected