Skip to content

Commit

Permalink
fix(component): ignore non-existing push branch when checking pending
Browse files Browse the repository at this point in the history
It can be non-existing yet (after initial setup) or removed after
merging a pull request.

Fixes #11613
Fixes WEBLATE-7NT
Fixes WEBLATE-7KT
  • Loading branch information
nijel committed May 13, 2024
1 parent 43e5c77 commit 66151d4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 2 additions & 0 deletions docs/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Not yet released.

**Bug fixes**

* False-positive merge failure alert when using push branch.

**Compatibility**

**Upgrading**
Expand Down
5 changes: 2 additions & 3 deletions weblate/trans/models/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -3245,9 +3245,8 @@ def count_push_branch_outgoing(self):
return 0
try:
return self.repository.count_outgoing(self.push_branch)
except RepositoryError as error:
report_error(cause="Could check merge needed", project=self.project)
self.add_alert("MergeFailure", error=self.error_text(error))
except RepositoryError:
# We silently ignore this error as push branch might not be existing if not needed
return 0

def needs_commit(self):
Expand Down

0 comments on commit 66151d4

Please sign in to comment.