Skip to content

Commit

Permalink
Run get_state_and_verify() as part of check_repo()
Browse files Browse the repository at this point in the history
  • Loading branch information
ambv committed Oct 11, 2023
1 parent f2f00cd commit 867b9cb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions cherry_picker/cherry_picker.py
Original file line number Diff line number Diff line change
Expand Up @@ -640,8 +640,9 @@ def check_repo(self):
"""
try:
validate_sha(self.config["check_sha"])
except ValueError:
raise InvalidRepoException()
self.get_state_and_verify()
except ValueError as ve:
raise InvalidRepoException(ve.args[0])

def get_state_and_verify(self):
"""Return the run progress state stored in the Git config.
Expand Down
2 changes: 1 addition & 1 deletion cherry_picker/test_cherry_picker.py
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,7 @@ class tested_state:
)
with mock.patch(
"cherry_picker.cherry_picker.validate_sha", return_value=True
), pytest.raises(ValueError, match=expected_msg_regexp):
), pytest.raises(InvalidRepoException, match=expected_msg_regexp):
cherry_picker = CherryPicker("origin", "xxx", [])


Expand Down

0 comments on commit 867b9cb

Please sign in to comment.