Skip to content

Commit e3fa3b9

Browse files
committed
Use a ClickExecption when alerting about missing pattern
1 parent f8733a6 commit e3fa3b9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

gitprivacy/gitprivacy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def get_crypto(self) -> Optional[EncryptionProvider]:
4848

4949
def get_dateredacter(self) -> DateRedacter:
5050
if self.mode == "reduce" and self.pattern == '':
51-
raise click.UsageError(click.wrap_text(
51+
raise click.ClickException(click.wrap_text(
5252
"Missing pattern configuration. Set a reduction pattern using\n" # noqa: E501
5353
"\n"
5454
f" git config {self.SECTION}.pattern <pattern>\n"

tests/test_gitprivacy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def test_redatenoconfig(self):
9494
self.setUpRepo()
9595
self.addCommit("a")
9696
result = self.invoke('redate')
97-
self.assertEqual(result.exit_code, 2)
97+
self.assertEqual(result.exit_code, 1)
9898

9999
def test_redate(self):
100100
with self.runner.isolated_filesystem():

0 commit comments

Comments
 (0)