aboutsummaryrefslogtreecommitdiffstats
path: root/libbe/command/commit.py
diff options
context:
space:
mode:
authorW. Trevor King <wking@drexel.edu>2011-05-25 10:39:51 -0400
committerW. Trevor King <wking@drexel.edu>2011-05-25 10:39:51 -0400
commitbf52e18aad6e0e8effcadc6b90dfedf4d15b1859 (patch)
treecd793ace48d79ebaf57aa2d7b2c67058c21582d1 /libbe/command/commit.py
parent0d5c9c68e947617c9d073d5f19351bdd8f3866db (diff)
downloadbugseverywhere-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/command/commit.py')
-rw-r--r--libbe/command/commit.py3
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'