diff options
author | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2021-05-06 16:22:05 -0400 |
---|---|---|
committer | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2021-05-06 16:22:05 -0400 |
commit | 7937ea7f4f521392f44c75971194b0684716affc (patch) | |
tree | 4059d4f1133101ea8f792edbeb49940f0044f7e0 | |
parent | 61446349212d46c02f86ab79dccdfa900b76f306 (diff) | |
download | patatt-7937ea7f4f521392f44c75971194b0684716affc.tar.gz |
Throw a KeyError, not RuntimeError
Don't die when running outside of a git checkout, just ignore ref:
keyring locations.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rw-r--r-- | patatt/__init__.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/patatt/__init__.py b/patatt/__init__.py index e54bb10..2f380e0 100644 --- a/patatt/__init__.py +++ b/patatt/__init__.py @@ -684,7 +684,7 @@ def get_public_key(source: str, keytype: str, identity: str, selector: str) -> T if source.find('ref:') == 0: gittop = get_git_toplevel() if not gittop: - raise RuntimeError('Not in a git tree, so cannot use a ref: source') + raise KeyError('Not in a git tree, so cannot use a ref: source') # format is: ref:refspec:path # or it could omit the refspec, meaning "whatever the current ref" # but it should always have at least two ":" |