diff options
author | Emiliano Ruiz Carletti <contact@eruizc.dev> | 2021-04-22 09:28:40 -0300 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2021-06-15 08:31:07 +1000 |
commit | b4e6850f98987d23a0211cb5b9b91d173c1e7210 (patch) | |
tree | 111eb0f851e07fd1e5dfe5a2f9496aa0452276f3 /pkg/gui/files_panel.go | |
parent | c57a0077d043bc0ecd3f4c8e0988c46655eecb94 (diff) |
Fix wrong ff-only configuration
Diffstat (limited to 'pkg/gui/files_panel.go')
-rw-r--r-- | pkg/gui/files_panel.go | 34 |
1 files changed, 3 insertions, 31 deletions
diff --git a/pkg/gui/files_panel.go b/pkg/gui/files_panel.go index faacf6fc8..4d225d945 100644 --- a/pkg/gui/files_panel.go +++ b/pkg/gui/files_panel.go @@ -4,7 +4,6 @@ import ( "fmt" "regexp" "strings" - "sync" "github.com/jesseduffield/gocui" "github.com/jesseduffield/lazygit/pkg/commands" @@ -660,42 +659,15 @@ func (gui *Gui) pullFiles(opts PullFilesOptions) error { return err } - mode := gui.getPullMode() + mode := &gui.Config.GetUserConfig().Git.Pull.Mode + *mode = gui.GitCommand.GetPullMode(*mode) // TODO: this doesn't look like a good idea. Why the goroutine? - go utils.Safe(func() { _ = gui.pullWithMode(mode, opts) }) + go utils.Safe(func() { _ = gui.pullWithMode(*mode, opts) }) return nil } -func (gui *Gui) getPullMode() string { - mode := &gui.Config.GetUserConfig().Git.Pull.Mode - if *mode == "auto" { - var isRebase bool - var isFf bool - var wg sync.WaitGroup - wg.Add(2) - go func() { - isRebase = gui.GitCommand.GetConfigValue("pull.rebase") == "true" - wg.Done() - }() - go func() { - isFf = gui.GitCommand.GetConfigValue("pull.ff") == "true" - wg.Done() - }() - wg.Wait() - - if isRebase { - *mode = "rebase" - } else if isFf { - *mode = "ff-only" - } else { - *mode = "merge" - } - } - return *mode -} - func (gui *Gui) pullWithMode(mode string, opts PullFilesOptions) error { gui.Mutexes.FetchMutex.Lock() defer gui.Mutexes.FetchMutex.Unlock() |