1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-05-31 23:19:40 +02:00

Revert "Read pull mode from git configuration"

This reverts commit e69e240a312bf990c9cf93a30648ceec5d3ee629.
This commit is contained in:
Emiliano Ruiz Carletti 2021-04-16 20:43:10 -03:00 committed by Jesse Duffield
parent d7865b3882
commit 46e500dc28

View File

@ -1,9 +1,5 @@
package config package config
import (
"github.com/jesseduffield/lazygit/pkg/secureexec"
)
type UserConfig struct { type UserConfig struct {
Gui GuiConfig `yaml:"gui"` Gui GuiConfig `yaml:"gui"`
Git GitConfig `yaml:"git"` Git GitConfig `yaml:"git"`
@ -327,7 +323,7 @@ func GetDefaultConfig() *UserConfig {
Args: "", Args: "",
}, },
Pull: PullConfig{ Pull: PullConfig{
Mode: getPullModeFromGitConfig(), Mode: "merge",
}, },
SkipHookPrefix: "WIP", SkipHookPrefix: "WIP",
AutoFetch: true, AutoFetch: true,
@ -489,17 +485,3 @@ func GetDefaultConfig() *UserConfig {
NotARepository: "prompt", NotARepository: "prompt",
} }
} }
func getPullModeFromGitConfig() string {
rebaseOut, rebaseErr := secureexec.Command("git config --get pull.rebase").Output()
if rebaseErr == nil && rebaseOut[0] == 't' {
return "rebase"
}
ffOut, ffErr := secureexec.Command("git config --get pull.ff").Output()
if ffErr == nil && ffOut[0] == 't' {
return "ff-only"
}
return "merge"
}