aboutsummaryrefslogtreecommitdiffstats
path: root/commands
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2018-10-17 20:59:36 +0200
committerMichael Muré <batolettre@gmail.com>2018-10-17 20:59:36 +0200
commitf67c57c08407b935c82b8f47d36823725351efe0 (patch)
treeec90dfebc77d7f25c2317e8286bce15cb9c5ffe9 /commands
parentb08e28e67e64d09f615bf6f863fd8d5f1b2f8f7f (diff)
downloadgit-bug-f67c57c08407b935c82b8f47d36823725351efe0.tar.gz
commands: check the bug id before the user write the message for "comment add"
Diffstat (limited to 'commands')
-rw-r--r--commands/comment_add.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/commands/comment_add.go b/commands/comment_add.go
index d720a09b..5a7cd6a8 100644
--- a/commands/comment_add.go
+++ b/commands/comment_add.go
@@ -21,6 +21,11 @@ func runCommentAdd(cmd *cobra.Command, args []string) error {
}
defer backend.Close()
+ b, args, err := _select.ResolveBug(backend, args)
+ if err != nil {
+ return err
+ }
+
if commentAddMessageFile != "" && commentAddMessage == "" {
commentAddMessage, err = input.FromFile(commentAddMessageFile)
if err != nil {
@@ -39,11 +44,6 @@ func runCommentAdd(cmd *cobra.Command, args []string) error {
}
}
- b, args, err := _select.ResolveBug(backend, args)
- if err != nil {
- return err
- }
-
err = b.AddComment(commentAddMessage)
if err != nil {
return err