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

Function tpt_cleanup_error

src/mcp/test_impact_tree.c:86–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84}
85
86static void tpt_cleanup_error(tpt_context *c, const cbm_pinned_tree_error_t *primary) {
87 cbm_pinned_tree_error_t cleanup = c->error;
88 c->error = *primary;
89 c->error.status = CBM_PINNED_TREE_CLEANUP_REQUIRED;
90 if (primary->status == CBM_PINNED_TREE_OK) {
91 c->error.cause = cleanup.status == CBM_PINNED_TREE_CHANGED ? CBM_PINNED_TREE_CHANGED
92 : CBM_PINNED_TREE_IO;
93 memcpy(c->error.diagnostic, cleanup.diagnostic, sizeof(c->error.diagnostic));
94 }
95 cbm_pinned_tree_t *t = c->tree;
96 for (size_t i = 0; t->objects && i < t->object_count; i++) {
97 if (t->objects[i].created) {
98 memcpy(c->error.cleanup_path, t->root_path, TPT_PATH_CAP);
99 break;
100 }
101 }
102}
103
104cbm_pinned_tree_status_t cbm_pinned_tree_create(const cbm_pinned_tree_options_t *o,
105 cbm_pinned_tree_t **out,

Callers 2

cbm_pinned_tree_createFunction · 0.85
cbm_pinned_tree_closeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected