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. */
| 87 | * Writes the resulting path into db_path. Returns 1 on success, 0 on setup |
| 88 | * failure. */ |
| 89 | static 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. */ |
| 103 | static void repro607_cleanup(const char *tmp_cache, const char *db_path) { |
no test coverage detected