mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-20 12:24:59 +00:00
refactor: Improve git push access check logging and error handling
This commit is contained in:
parent
9c1d050d8b
commit
748099a324
1 changed files with 4 additions and 3 deletions
|
@ -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():
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue