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

Function apply

tests/test_runtime_settings.c:68–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66 return document;
67}
68static char *apply(const char *path, const char *changes, int *status) {
69 yyjson_doc *before = read_snapshot(path);
70 if (!before)
71 return NULL;
72 const char *revision = yyjson_get_str(yyjson_obj_get(yyjson_doc_get_root(before), "revision"));
73 char request[4096];
74 snprintf(request, sizeof(request), "{\"revision\":\"%s\",\"changes\":%s}", revision, changes);
75 yyjson_doc_free(before);
76 return cbm_runtime_settings_apply_json(path, request, strlen(request), status);
77}
78
79TEST(runtime_settings_atomic_validation_and_conflict) {
80 settings_fixture_t fixture;

Callers 1

Calls 2

read_snapshotFunction · 0.85

Tested by

no test coverage detected