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

Function cli_checksum_manifest_path

tests/test_cli.c:12539–12559  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12537}
12538
12539static bool cli_checksum_manifest_path(char *path, size_t path_size) {
12540 int written = snprintf(path, path_size, "%s/cbm-checksum-XXXXXX", cbm_tmpdir());
12541 if (written <= 0 || (size_t)written >= path_size) {
12542 return false;
12543 }
12544 int descriptor = cbm_mkstemp(path);
12545 if (descriptor < 0) {
12546 return false;
12547 }
12548 FILE *file = fdopen(descriptor, "wb");
12549 if (!file) {
12550#ifdef _WIN32
12551 (void)_close(descriptor);
12552#else
12553 (void)close(descriptor);
12554#endif
12555 (void)cbm_unlink(path);
12556 return false;
12557 }
12558 return fclose(file) == 0;
12559}
12560
12561TEST(cli_checksum_manifest_requires_exact_filename_and_accepts_star) {
12562 static const char lower_digest[] =

Callers 1

test_cli.cFile · 0.85

Calls 3

cbm_tmpdirFunction · 0.85
cbm_mkstempFunction · 0.85
cbm_unlinkFunction · 0.85

Tested by

no test coverage detected