refactor: Improve git push access check logging and error handling

This commit is contained in:
Paul Gauthier 2025-03-04 14:02:27 -08:00 committed by Paul Gauthier (aider)
parent 9c1d050d8b
commit 748099a324

View file

@ -67,13 +67,14 @@ def check_main_branch_up_to_date():
def check_push_access(): def check_push_access():
print("Checking push access to origin repository...") print("Checking push access to origin repository...")
result = subprocess.run(["git", "push", "--dry-run", "origin"], capture_output=True, text=True) result = subprocess.run(["git", "push", "--dry-run", "origin"], capture_output=True, text=True)
print(result.stdout)
print(result.stderr)
if result.returncode != 0: if result.returncode != 0:
print("Error: Cannot push to origin repository.") print("Error: Cannot push to origin repository.")
print(result.stderr)
sys.exit(1) sys.exit(1)
print("Push access to origin repository confirmed.") print("Push access to origin repository confirmed.")
print("Git output:")
print(result.stdout)
def main(): def main():