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

Function repro607_make_index

tests/repro/repro_issue607.c:89–100  ·  view source on GitHub ↗

Create a real index DB at / .db with one * project row, mirroring the state of a user who ran index_repository once. * Writes the resulting path into db_path. Returns 1 on success, 0 on setup * failure. */

Source from the content-addressed store, hash-verified

87 * Writes the resulting path into db_path. Returns 1 on success, 0 on setup
88 * failure. */
89static int repro607_make_index(const char *tmp_cache, char *db_path, size_t db_path_sz) {
90 snprintf(db_path, db_path_sz, "%s/%s.db", tmp_cache, REPRO607_PROJECT);
91
92 cbm_store_t *setup_store = cbm_store_open_path(db_path);
93 if (!setup_store) {
94 return 0;
95 }
96 int upsert_rc =
97 cbm_store_upsert_project(setup_store, REPRO607_PROJECT, "/home/user/my-project");
98 cbm_store_close(setup_store);
99 return (upsert_rc == CBM_STORE_OK) ? 1 : 0;
100}
101
102/* Best-effort cleanup of the temp cache dir + DB sidecar files. */
103static void repro607_cleanup(const char *tmp_cache, const char *db_path) {

Callers 1

repro_issue607.cFile · 0.85

Calls 3

cbm_store_open_pathFunction · 0.85
cbm_store_upsert_projectFunction · 0.85
cbm_store_closeFunction · 0.85

Tested by

no test coverage detected