| 6847 | /* ── Helper: get project root_path from store ─────────────────── */ |
| 6848 | |
| 6849 | static char *project_root_from_store(cbm_store_t *store, const char *project) { |
| 6850 | if (!store || !project) { |
| 6851 | return NULL; |
| 6852 | } |
| 6853 | cbm_project_t proj = {0}; |
| 6854 | if (cbm_store_get_project(store, project, &proj) != CBM_STORE_OK) { |
| 6855 | return NULL; |
| 6856 | } |
| 6857 | char *root = heap_strdup(proj.root_path); |
| 6858 | safe_str_free(&proj.name); |
| 6859 | safe_str_free(&proj.indexed_at); |
| 6860 | safe_str_free(&proj.root_path); |
| 6861 | return root; |
| 6862 | } |
| 6863 | |
| 6864 | static char *get_project_root(cbm_mcp_server_t *srv, const char *project) { |
| 6865 | return project_root_from_store(resolve_store(srv, project), project); |
no test coverage detected