Stage and commit a list of files.
(files: list[Path], message: str)
| 382 | |
| 383 | |
| 384 | def commit_files(files: list[Path], message: str) -> bool: |
| 385 | """Stage and commit a list of files.""" |
| 386 | for f in files: |
| 387 | code, _, err = run_git(["add", str(f)]) |
| 388 | if code != 0: |
| 389 | print(f"ERROR: Failed to stage {f}: {err}") |
| 390 | return False |
| 391 | |
| 392 | code, _, err = run_git(["commit", "-m", message]) |
| 393 | if code != 0: |
| 394 | print(f"ERROR: Failed to commit: {err}") |
| 395 | return False |
| 396 | return True |
| 397 | |
| 398 | |
| 399 | def push_branch(branch_name: str) -> bool: |
no test coverage detected