File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -249,16 +249,16 @@ def git_repo_exists_at_path(repo_root: Path) -> bool:
249249def push_changes_prompt_if_fail (repo_root : Path ) -> None :
250250 """Attempt to push changes, including tags, for the repository at the given filesystem path.
251251
252- In case of failure, ask the user
253- if they would like to try again. Loop until pushing changes succeeds or the
254- user answers opts to not try again.
252+ In case of failure, ask the user if they would like to try again.
253+ Loop until pushing changes succeeds or the user answers opts to not try again.
255254 """
256255 while True :
257- cmd = f"(cd { repo_root } && git push --tags)"
258- result = os .system (cmd )
259- cmd = f"(cd { repo_root } && git push origin master)"
260- result = os .system (cmd )
261- if result == 0 :
256+ cmd = f"git -C { repo_root } push --tags"
257+ subprocess .run ([cmd ], shell = False , check = False )
258+ cmd = f"git -C { repo_root } push origin master"
259+ result = subprocess .run ([cmd ], shell = False , check = False )
260+ # Only check the second command, on the theory that both will succeed or both will fail.
261+ if result .returncode == 0 :
262262 break
263263 print (
264264 f"Could not push from: { repo_root } ; result={ result } for command: `{ cmd } `"
You can’t perform that action at this time.
0 commit comments