Skip to content

Commit

Permalink
Fix success handling for update_repos (#1520)
Browse files Browse the repository at this point in the history
* Fix success handling for update_repos

As part of the switch to python git, the success case handling was reversed even though `0` was still meant to indicate success (formerly used to represent process exited without error).

89bce02#diff-b279f20d61152a2a99689009a59d70609c92039568c203da8c84bb56ceacd94fR287

This pull request fixes that issue and makes the code a bit more clear by using booleans rather than integers to represent the success state.

* docs: Add fixes to CHANGES

Co-authored-by: Sijis Aviles <[email protected]>
  • Loading branch information
bboe and sijis committed Jun 11, 2022
1 parent 55442c5 commit 1ff4fc7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
v6.1.9 (unreleased)
-------------------

fixes:

- core: success handling for update_repos (#1520)

v6.1.8 (2021-06-21)
-------------------

Expand Down
4 changes: 2 additions & 2 deletions errbot/repo_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,11 +298,11 @@ def update_repos(self, repos) -> Generator[Tuple[str, int, str], None, None]:
names = set(self.get_installed_plugin_repos().keys()).intersection(set(repos))

for d in (path.join(self.plugin_dir, name) for name in names):
success = 1
success = False
try:
git_pull(d)
feedback = "Pulled remote"
success = 0
success = True
except Exception as exception:
feedback = f"Error pulling remote {exception}"
pass
Expand Down

0 comments on commit 1ff4fc7

Please sign in to comment.