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

Function update_prepare_clear_indexes

src/cli/cli.c:11316–11339  ·  view source on GitHub ↗

Confirm index deletion before network I/O, but defer the deletion itself to * the final guarded activation after the verified binary is ready. Returns 0 * to continue and 1 to abort. */

Source from the content-addressed store, hash-verified

11314 * the final guarded activation after the verified binary is ready. Returns 0
11315 * to continue and 1 to abort. */
11316static int update_prepare_clear_indexes(const char *home, bool dry_run, bool *delete_indexes_out) {
11317 if (delete_indexes_out) {
11318 *delete_indexes_out = false;
11319 }
11320 int index_count = count_db_indexes(home);
11321 if (index_count == 0) {
11322 return 0;
11323 }
11324 printf("Found %d existing index(es) that must be rebuilt after update:\n", index_count);
11325 cbm_list_indexes(home);
11326 printf("\n");
11327 if (dry_run) {
11328 printf("(dry-run — indexes would be deleted)\n\n");
11329 return 0;
11330 }
11331 if (!prompt_yn("Delete these indexes and continue with update?")) {
11332 printf("Update cancelled.\n");
11333 return CLI_TRUE;
11334 }
11335 if (delete_indexes_out) {
11336 *delete_indexes_out = true;
11337 }
11338 return 0;
11339}
11340
11341/* Download and verify before disruption, then activate under daemon locks. */
11342static int download_verify_install(const char *url, const char *ext, const char *os,

Callers 1

cbm_cmd_updateFunction · 0.85

Calls 3

count_db_indexesFunction · 0.85
cbm_list_indexesFunction · 0.85
prompt_ynFunction · 0.85

Tested by

no test coverage detected