segfault when trying to rebase&&merge
Created by: maxice8
Description
Segfault on retry.Do
function, when merging a merge request that needs to be rebased.
after the segfault if it is asked to merge again then it will work normally
Expected Behavior vs Actual Behavior
that it is merged instead of segfault
Steps to Reproduce
- Find a merge request that needs to be rebased
- run
gllab mr merge --yes --rebase --when-pipeline-succeeds=false <MR-IDENTIFIER>
- See error
Logs
✓ Rebase successful
| Merging merge request !21321 panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0xbdb797]
goroutine 1 [running]:
github.com/profclems/glab/commands/mr/merge.NewCmdMerge.func1.1(0xc0008d1aa8, 0xc0008d1a78)
github.com/profclems/glab/commands/mr/merge/mr_merge.go:187 +0xb7
github.com/avast/retry-go.Do(0xc0008d1c50, 0x0, 0x0, 0x0, 0x1, 0x1)
github.com/avast/retry-go@v3.0.0+incompatible/retry.go:127 +0x1cc
github.com/profclems/glab/commands/mr/merge.NewCmdMerge.func1(0xc000580280, 0xc0000ccc40, 0x1, 0x4, 0x0, 0x0)
github.com/profclems/glab/commands/mr/merge/mr_merge.go:184 +0x6ad
github.com/spf13/cobra.(*Command).execute(0xc000580280, 0xc0000ccc00, 0x4, 0x4, 0xc000580280, 0xc0000ccc00)
github.com/spf13/cobra@v1.1.3/command.go:852 +0x472
github.com/spf13/cobra.(*Command).ExecuteC(0xc0002a8f00, 0xc00000e018, 0x7a, 0x6)
github.com/spf13/cobra@v1.1.3/command.go:960 +0x375
main.main()
github.com/profclems/glab/cmd/glab/main.go:140 +0x7d7
Your Environment
- Version used (Run
glab --version
): glab version 1.16.0-66-g649df1c (2021-05-12) - Operating System and version: Fedora Silverblue 34