From 76f13de681a994813b642bab847a40e5e318b4b7 Mon Sep 17 00:00:00 2001 From: m3taversal Date: Tue, 24 Mar 2026 11:43:27 +0000 Subject: [PATCH] fix: delete existing branch before re-creating in decision extractor Pentagon-Agent: Epimetheus <3D35839A-7722-4740-B93D-51157F7D5E70> --- extract-decisions.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/extract-decisions.py b/extract-decisions.py index 97068f1..b90cbb8 100644 --- a/extract-decisions.py +++ b/extract-decisions.py @@ -388,6 +388,8 @@ def _prepare_branch(branch_name: str) -> bool: subprocess.run(["git", "fetch", "origin", "main"], cwd=cwd, check=True, capture_output=True) subprocess.run(["git", "checkout", "main"], cwd=cwd, check=True, capture_output=True) subprocess.run(["git", "reset", "--hard", "origin/main"], cwd=cwd, check=True, capture_output=True) + # Delete branch if it already exists (from a failed previous run) + subprocess.run(["git", "branch", "-D", branch_name], cwd=cwd, capture_output=True) subprocess.run(["git", "checkout", "-b", branch_name], cwd=cwd, check=True, capture_output=True) print(f"Branch created: {branch_name}") return True