Skip to content

Commit fff0514

Browse files
committed
Avoid triggering recovery mechanism when cancelling issue/pr create
1 parent b0b90af commit fff0514

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pkg/cmd/issue/create/create.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,8 @@ func createRun(opts *CreateOptions) (err error) {
249249

250250
if action == prShared.CancelAction {
251251
fmt.Fprintln(opts.IO.ErrOut, "Discarding.")
252-
err = cmdutil.SilentError
253-
return
252+
err = nil // avoid triggering PreserveInput
253+
return cmdutil.SilentError
254254
}
255255
} else {
256256
if tb.Title == "" {

pkg/cmd/pr/create/create.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,8 @@ func createRun(opts *CreateOptions) (err error) {
299299

300300
if action == shared.CancelAction {
301301
fmt.Fprintln(opts.IO.ErrOut, "Discarding.")
302-
err = cmdutil.SilentError
303-
return
302+
err = nil // avoid triggering PreserveInput
303+
return cmdutil.SilentError
304304
}
305305

306306
err = handlePush(*opts, *ctx)

0 commit comments

Comments
 (0)