`issue create` panics when -R OWNER/REPO is specified
Description
glab issue create
panics when the repo is overriden and the remote does not exist.
This happens after selecting metadata to add.
Expected Behavior vs Actual Behavior
Possible Fix
Steps to Reproduce
- Type this 'glab issue create -R glab-cli/test'
- Make sure you have no remote pointing to
glab-cli/test
- Select template, enter title and description and select add metadata
- Select labels and press enter
- See error
Logs
→ glab issue create -R clemsbot/test
go run -trimpath -ldflags "-X main.build=2021-01-08 -X main.version=v1.13.1-235-g1e68374 -X main.debugMode=true" ./cmd/glab issue create -R clemsbot/test
? Choose a template Open a blank Issue
? Title dfgg
? Description <Received>
? What's next? Add metadata
? Which metadata types to add? labels
panic: interface conversion: glrepo.Interface is *glrepo.glRepo, not *glrepo.Remote
goroutine 1 [running]:
github.com/profclems/glab/commands/issue/create.createRun(0xc0001246e0, 0xd0af00, 0xc0006e3950)
github.com/profclems/glab/commands/issue/create/issue_create.go:240 +0x1546
github.com/profclems/glab/commands/issue/create.NewCmdCreate.func1(0xc000524dc0, 0xc0006df5c0, 0x0, 0x2, 0x0, 0x0)
github.com/profclems/glab/commands/issue/create/issue_create.go:101 +0x1ed
github.com/spf13/cobra.(*Command).execute(0xc000524dc0, 0xc0006df5a0, 0x2, 0x2, 0xc000524dc0, 0xc0006df5a0)
github.com/spf13/cobra@v1.1.1/command.go:850 +0x47c
github.com/spf13/cobra.(*Command).ExecuteC(0xc0003d4580, 0xc00000e018, 0xc4, 0x4)
github.com/spf13/cobra@v1.1.1/command.go:958 +0x375
main.main()
github.com/profclems/glab/cmd/glab/main.go:116 +0x793
exit status 2
make: *** [Makefile:76: run] Error 1
Your Environment
- Version used (Run
glab --version
): Built from trunk 1e683743 - Operating System and version: Arch Linux x86_64 (5.10.5-arch1-1)