Skip to content

Commit 9da5efc

Browse files
committed
Modify command function to only have one return
1 parent b9b6e85 commit 9da5efc

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

repobee_sanitizer/sanitizer.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,13 @@ def command(self) -> Optional[plug.Result]:
8585
if self.no_commit
8686
else self._sanitize_to_target_branch()
8787
)
88+
status = plug.Status.SUCCESS
8889
except _SanitizeError as err:
89-
return plug.Result(
90-
name="sanitize-repo", msg=err.msg, status=plug.Status.ERROR
91-
)
90+
result_message = err.msg
91+
status = plug.Status.ERROR
9292

9393
return plug.Result(
94-
name="sanitize-repo",
95-
msg=result_message,
96-
status=plug.Status.SUCCESS,
94+
name="sanitize-repo", msg=result_message, status=status
9795
)
9896

9997
def _sanitize_no_commit(self) -> str:
@@ -134,7 +132,7 @@ def _resolve_effective_target_branch(self, repo_root: pathlib.Path) -> str:
134132
return self.target_branch
135133

136134
def _validate_input(self) -> plug.Result:
137-
message = _sanitize_repo.check_repo_state(self.repo_root)
135+
message = _gitutils.check_repo_state(self.repo_root)
138136
if message and not self.force:
139137
raise _SanitizeError(msg=message)
140138

0 commit comments

Comments
 (0)