1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

Fix wrong ff-only configuration

This commit is contained in:
Emiliano Ruiz Carletti
2021-04-22 09:28:40 -03:00
committed by Jesse Duffield
parent c57a0077d0
commit b4e6850f98
2 changed files with 33 additions and 31 deletions

View File

@ -2,6 +2,7 @@ package commands
import (
"fmt"
"sync"
)
// Push pushes to a branch
@ -59,3 +60,32 @@ func (c *GitCommand) FetchRemote(remoteName string, promptUserForCredential func
command := fmt.Sprintf("git fetch %s", remoteName)
return c.OSCommand.DetectUnamePass(command, promptUserForCredential)
}
func (c *GitCommand) GetPullMode(mode string) string {
if mode != "auto" {
return mode
}
var isRebase bool
var isFf bool
var wg sync.WaitGroup
wg.Add(2)
go func() {
isRebase = c.GetConfigValue("pull.rebase") == "true"
wg.Done()
}()
go func() {
isFf = c.GetConfigValue("pull.ff") == "only"
wg.Done()
}()
wg.Wait()
if isRebase {
return "rebase"
} else if isFf {
return "ff-only"
} else {
return "merge"
}
}