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:
parent
d7865b3882
commit
46e500dc28
@ -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"
|
|
||||||
}
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user