Skip to content

Commit

Permalink
component: Gracefully handle if upstream has moved while pushing
Browse files Browse the repository at this point in the history
  • Loading branch information
nijel committed Aug 4, 2023
1 parent 80bfa11 commit 0e61a2e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions weblate/trans/models/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -1660,8 +1660,12 @@ def push_repo(self, request, retry=True):
)
if retry:
if "Host key verification failed" in error_text:
# Try adding SSH key and retry
self.add_ssh_host_key()
return self.push_repo(request, retry=False)
if "fetch first" in error_text:
# Upstream has moved, try additional update via calling do_push
return self.do_push(request, retry=False)
if (
"shallow update not allowed" in error_text
or "expected old/new/ref, got 'shallow" in error_text
Expand Down

0 comments on commit 0e61a2e

Please sign in to comment.