1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-31 14:24:25 +03:00

Wraps rebase func with WithWaitingStatus to show loader when rebasing

This commit is contained in:
Karl Heitmann
2023-07-28 21:27:15 -04:00
parent 6984a4f4d4
commit c7e6a73512

View File

@ -4,6 +4,7 @@ import (
"fmt"
"strings"
"github.com/jesseduffield/gocui"
"github.com/jesseduffield/lazygit/pkg/commands/git_commands"
"github.com/jesseduffield/lazygit/pkg/commands/types/enums"
"github.com/jesseduffield/lazygit/pkg/gui/types"
@ -224,6 +225,7 @@ func (self *MergeAndRebaseHelper) RebaseOntoRef(ref string) error {
Key: 's',
OnPress: func() error {
self.c.LogAction(self.c.Tr.Actions.RebaseBranch)
return self.c.WithWaitingStatus(self.c.Tr.RebasingStatus, func(task gocui.Task) error {
baseCommit := self.c.Modes().MarkedBaseCommit.GetSha()
var err error
if baseCommit != "" {
@ -236,6 +238,7 @@ func (self *MergeAndRebaseHelper) RebaseOntoRef(ref string) error {
self.c.Modes().MarkedBaseCommit.Reset()
}
return err
})
},
},
{