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

Function update_prepare_clear_indexes

src/cli/cli.c:11730–11753  ·  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

11728 * the final guarded activation after the verified binary is ready. Returns 0
11729 * to continue and 1 to abort. */
11730static int update_prepare_clear_indexes(const char *home, bool dry_run, bool *delete_indexes_out) {
11731 if (delete_indexes_out) {
11732 *delete_indexes_out = false;
11733 }
11734 int index_count = count_db_indexes(home);
11735 if (index_count == 0) {
11736 return 0;
11737 }
11738 printf("Found %d existing index(es) that must be rebuilt after update:\n", index_count);
11739 cbm_list_indexes(home);
11740 printf("\n");
11741 if (dry_run) {
11742 printf("(dry-run — indexes would be deleted)\n\n");
11743 return 0;
11744 }
11745 if (!prompt_yn("Delete these indexes and continue with update?")) {
11746 printf("Update cancelled.\n");
11747 return CLI_TRUE;
11748 }
11749 if (delete_indexes_out) {
11750 *delete_indexes_out = true;
11751 }
11752 return 0;
11753}
11754
11755/* Download and verify before disruption, then activate under daemon locks. */
11756static 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