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)