From fff051468eb793e89e946f4eac6ed1f5ab1efd20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Tue, 23 Feb 2021 19:42:41 +0100 Subject: [PATCH] Avoid triggering recovery mechanism when cancelling `issue/pr create` --- pkg/cmd/issue/create/create.go | 4 ++-- pkg/cmd/pr/create/create.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/cmd/issue/create/create.go b/pkg/cmd/issue/create/create.go index 3d6b5b25c..298f3bf97 100644 --- a/pkg/cmd/issue/create/create.go +++ b/pkg/cmd/issue/create/create.go @@ -249,8 +249,8 @@ func createRun(opts *CreateOptions) (err error) { if action == prShared.CancelAction { fmt.Fprintln(opts.IO.ErrOut, "Discarding.") - err = cmdutil.SilentError - return + err = nil // avoid triggering PreserveInput + return cmdutil.SilentError } } else { if tb.Title == "" { diff --git a/pkg/cmd/pr/create/create.go b/pkg/cmd/pr/create/create.go index 18b8c1e99..a56410726 100644 --- a/pkg/cmd/pr/create/create.go +++ b/pkg/cmd/pr/create/create.go @@ -299,8 +299,8 @@ func createRun(opts *CreateOptions) (err error) { if action == shared.CancelAction { fmt.Fprintln(opts.IO.ErrOut, "Discarding.") - err = cmdutil.SilentError - return + err = nil // avoid triggering PreserveInput + return cmdutil.SilentError } err = handlePush(*opts, *ctx)