mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 05:34:18 +08:00
[GHF] Retry push unconditionally (#77426)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/77426 Approved by: https://github.com/seemethere
This commit is contained in:
committed by
PyTorch MergeBot
parent
3077e9059c
commit
2fc1725938
4
.github/scripts/gitutils.py
vendored
4
.github/scripts/gitutils.py
vendored
@ -248,9 +248,7 @@ class GitRepo:
|
||||
else:
|
||||
self._run_git("push", self.remote, branch)
|
||||
except RuntimeError as e:
|
||||
# Check if push were rejected because branch is stale
|
||||
if len(e.args) == 0 or re.search(r"\[rejected\].+\(fetch first\)\n", e.args[0]) is None:
|
||||
raise
|
||||
print(f"{cnt} push attempt failed with {e}")
|
||||
self.fetch()
|
||||
self._run_git("rebase", f"{self.remote}/{branch}")
|
||||
|
||||
|
Reference in New Issue
Block a user