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

Function pt_oid

tests/test_test_impact_tree.c:536–552  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

534}
535
536static bool pt_oid(pt_fixture *fx, const char *const *argv, char out[65]) {
537 char bytes[80];
538 if (!pt_git(fx, argv, bytes, sizeof(bytes)))
539 return false;
540 size_t n = strlen(bytes);
541 if (n && bytes[n - 1] == '\n')
542 bytes[--n] = 0;
543 if (n && bytes[n - 1] == '\r')
544 bytes[--n] = 0;
545 if (n != fx->width)
546 return false;
547 for (size_t i = 0; i < n; i++)
548 if (!((bytes[i] >= '0' && bytes[i] <= '9') || (bytes[i] >= 'a' && bytes[i] <= 'f')))
549 return false;
550 memcpy(out, bytes, n + 1);
551 return true;
552}
553
554static bool pt_object(pt_fixture *fx, const char *type, const void *bytes, size_t length,
555 char out[65]) {

Callers 2

pt_objectFunction · 0.85
pt_index_treeFunction · 0.85

Calls 1

pt_gitFunction · 0.85

Tested by

no test coverage detected