diff --git a/cmd/mr_approve.go b/cmd/mr_approve.go index cd6a9323..8e82775a 100644 --- a/cmd/mr_approve.go +++ b/cmd/mr_approve.go @@ -48,6 +48,15 @@ var mrApproveCmd = &cobra.Command{ log.Fatal(err) } + if comment || len(msgs) > 0 || filename != "" { + linebreak, err := cmd.Flags().GetBool("force-linebreak") + if err != nil { + log.Fatal(err) + } + + createNote(rn, true, int(id), msgs, filename, linebreak, "") + } + err = lab.MRApprove(p.ID, int(id)) if err != nil { if err == lab.ErrStatusForbidden { @@ -59,15 +68,6 @@ var mrApproveCmd = &cobra.Command{ } } - if comment || len(msgs) > 0 || filename != "" { - linebreak, err := cmd.Flags().GetBool("force-linebreak") - if err != nil { - log.Fatal(err) - } - - createNote(rn, true, int(id), msgs, filename, linebreak, "") - } - fmt.Printf("Merge Request !%d approved\n", id) }, }