fix(update): stop on merge conflicts instead of committing the markers

This commit is contained in:
hh committed 2026-10-01 02:06:55 +02:00
1 parent 3d85e6f29c
commit 2b332da0a2
1 file changed
+4
+4
View File
@@ -140,6 +140,10 @@ def update(args: argparse.Namespace) -> None:
for file in answers: for file in answers:
run_update(".", answers_file=str(file), unsafe=True, overwrite=True, run_update(".", answers_file=str(file), unsafe=True, overwrite=True,
skip_answered=not args.ask, defaults=args.defaults, vcs_ref=REF) 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) refresh_locks(file.stem)
if git_dirty(): if git_dirty():
subprocess.run(["git", "add", "-A"], check=True) subprocess.run(["git", "add", "-A"], check=True)