From 6d11eab503894f39446352c7fa5f9a59056849a1 Mon Sep 17 00:00:00 2001 From: Dylan De Faoite Date: Tue, 27 Jan 2026 23:34:09 +0000 Subject: [PATCH] fix: incorrect file removal loop --- rewind/state.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/rewind/state.py b/rewind/state.py index fa6e2bd..a3e9974 100644 --- a/rewind/state.py +++ b/rewind/state.py @@ -46,12 +46,7 @@ def cleanup_state_files() -> None: files = state.get("files", []) # Remove old files from state - for file in files: - if not os.path.exists(file["path"]): - files.remove(file) - print(f"Removed non-existent file from state: {file['path']}") - - state["files"] = files + state["files"] = [file for file in files if not os.path.exists(file["path"])] write_state(state) def create_state_file_if_needed() -> None: