From 2b332da0a2ac12e7bb21871879ce401f296d400e Mon Sep 17 00:00:00 2001 From: h Date: Thu, 1 Oct 2026 02:06:55 +0200 Subject: [PATCH] fix(update): stop on merge conflicts instead of committing the markers --- templates.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/templates.py b/templates.py index 2ebabff..5104d73 100644 --- a/templates.py +++ b/templates.py @@ -140,6 +140,10 @@ def update(args: argparse.Namespace) -> None: for file in answers: run_update(".", answers_file=str(file), unsafe=True, overwrite=True, skip_answered=not args.ask, defaults=args.defaults, vcs_ref=REF) + conflicts = subprocess.run(["git", "diff", "--name-only", "--diff-filter=U"], + capture_output=True, text=True, check=False).stdout.split() + if conflicts: + sys.exit(f"{file.stem}: resolve conflicts, then commit and rerun:\n " + "\n ".join(conflicts)) refresh_locks(file.stem) if git_dirty(): subprocess.run(["git", "add", "-A"], check=True)