diff options
author | W. Trevor King <wking@drexel.edu> | 2011-05-25 10:39:51 -0400 |
---|---|---|
committer | W. Trevor King <wking@drexel.edu> | 2011-05-25 10:39:51 -0400 |
commit | bf52e18aad6e0e8effcadc6b90dfedf4d15b1859 (patch) | |
tree | cd793ace48d79ebaf57aa2d7b2c67058c21582d1 /libbe | |
parent | 0d5c9c68e947617c9d073d5f19351bdd8f3866db (diff) | |
download | bugseverywhere-bf52e18aad6e0e8effcadc6b90dfedf4d15b1859.tar.gz |
Raise UserError if summary is not given to `be commit`.
If the user doesn't provide the summary on the command line, through
stdin, or through editor_string, raise an error. This will generally
happen with
$ be commit
(user doesn't enter any text in the editory)
Diffstat (limited to 'libbe')
-rw-r--r-- | libbe/command/commit.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libbe/command/commit.py b/libbe/command/commit.py index 32ca3ef..8416107 100644 --- a/libbe/command/commit.py +++ b/libbe/command/commit.py @@ -84,6 +84,9 @@ class Commit (libbe.command.Command): body = libbe.util.encoding.get_file_contents( params['body'], decode=True) if summary == None: # use the first body line as the summary + if body == None: + raise libbe.command.UserError( + 'cannot commit without a summary') lines = body.splitlines() summary = lines[0] body = '\n'.join(lines[1:]).strip() + '\n' |