From 5d5a1fae7b28c0fb7ecd817e0446ef60c3c25f09 Mon Sep 17 00:00:00 2001 From: Hiroshi Nishio <4620828+hiroshinishio@users.noreply.github.com> Date: Tue, 9 Jul 2024 17:34:19 +0900 Subject: [PATCH] Fix: Failed to apply patch. stdout: The next patch would create the file /tmp/tmpy0d9mb0r, which already exists! Assume -R? [n] Apply anyway? [n] Skipping patch. 1 out of 1 hunk ignored --- utils/file_manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/file_manager.py b/utils/file_manager.py index 0bd71280..24d2c43b 100644 --- a/utils/file_manager.py +++ b/utils/file_manager.py @@ -58,7 +58,7 @@ def apply_patch(original_text: str, diff_text: str) -> str: cmd, code = " ".join(e.cmd), e.returncode # Check if the error message indicates that the patch was already applied - if "which already exists! assume -r? [n]" in stdout.lower(): + if "which already exists!" in stdout.lower(): return "" # Get the original, diff, and reject file contents for debugging