| 3177 | /* ── Helper: get project root_path from store ─────────────────── */ |
| 3178 | |
| 3179 | static 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 |
no test coverage detected