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

Function get_project_root

src/mcp/mcp.c:3179–3196  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3177/* ── Helper: get project root_path from store ─────────────────── */
3178
3179static char *get_project_root(cbm_mcp_server_t *srv, const char *project) {
3180 if (!project) {
3181 return NULL;
3182 }
3183 cbm_store_t *store = resolve_store(srv, project);
3184 if (!store) {
3185 return NULL;
3186 }
3187 cbm_project_t proj = {0};
3188 if (cbm_store_get_project(store, project, &proj) != CBM_STORE_OK) {
3189 return NULL;
3190 }
3191 char *root = heap_strdup(proj.root_path);
3192 safe_str_free(&proj.name);
3193 safe_str_free(&proj.indexed_at);
3194 safe_str_free(&proj.root_path);
3195 return root;
3196}
3197
3198/* ── index_repository ─────────────────────────────────────────── */
3199

Callers 4

build_snippet_responseFunction · 0.85
handle_search_codeFunction · 0.85
handle_detect_changesFunction · 0.85
handle_manage_adrFunction · 0.85

Calls 4

resolve_storeFunction · 0.85
cbm_store_get_projectFunction · 0.85
safe_str_freeFunction · 0.85
heap_strdupFunction · 0.70

Tested by

no test coverage detected