preserve tmp mountpoint on reset

This commit is contained in:
yuyr 2026-06-29 18:20:47 +08:00
parent b83acb281b
commit 0610a8291c

View File

@ -466,6 +466,12 @@ move_if_exists() {
fi
}
clear_dir_contents() {
local dir_path="$1"
[[ -d "$dir_path" ]] || return 0
find "$dir_path" -mindepth 1 -maxdepth 1 -exec rm -rf {} +
}
db_state_exists() {
[[ -e "$DB_DIR/work-db" || -e "$DB_DIR/repo-bytes.db" ]]
}
@ -486,7 +492,7 @@ isolate_state_after_failure() {
INVALID_TMP_PATH="$TMP_DIR"
TMP_CLEANUP_STATUS="pending"
TMP_CLEANUP_REASON="discard_after_failure"
rm -rf "$TMP_DIR"
clear_dir_contents "$TMP_DIR"
mkdir -p "$TMP_DIR"
TMP_CLEANUP_STATUS="discarded_recreated"
else