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

Function gf_oid

tests/test_test_impact_git.c:165–182  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

163}
164
165static bool gf_oid(gf_fixture_t *fx, const char *const *argv, char out[65]) {
166 char text[80];
167 if (!gf_git(fx, argv, text, sizeof(text)))
168 return false;
169 size_t n = strlen(text);
170 if (n && text[n - 1] == '\n')
171 text[--n] = '\0';
172 if (n && text[n - 1] == '\r')
173 text[--n] = '\0';
174 if (n != fx->oid_length)
175 return false;
176 for (size_t i = 0; i < n; i++) {
177 if (!((text[i] >= '0' && text[i] <= '9') || (text[i] >= 'a' && text[i] <= 'f')))
178 return false;
179 }
180 memcpy(out, text, n + 1);
181 return true;
182}
183
184static bool gf_object(gf_fixture_t *fx, const char *type, const void *bytes, size_t length,
185 char out[65]) {

Callers 4

gf_objectFunction · 0.70
gf_treeFunction · 0.70
gfi_raw_tree_formatFunction · 0.70

Calls 1

gf_gitFunction · 0.85

Tested by

no test coverage detected