1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-11-25 04:43:08 +03:00

standardise how we read from the config

This commit is contained in:
Jesse Duffield
2020-11-25 08:52:00 +11:00
parent 7513bfb13a
commit 999e170f1d
8 changed files with 240 additions and 234 deletions

View File

@@ -13,10 +13,7 @@ func (c *GitCommand) usingGpg() bool {
return false
}
gpgsign, _ := c.getLocalGitConfig("commit.gpgsign")
if gpgsign == "" {
gpgsign, _ = c.getGlobalGitConfig("commit.gpgsign")
}
gpgsign := c.GetConfigValue("commit.gpgsign")
value := strings.ToLower(gpgsign)
return value == "true" || value == "1" || value == "yes" || value == "on"
@@ -25,14 +22,8 @@ func (c *GitCommand) usingGpg() bool {
// Push pushes to a branch
func (c *GitCommand) Push(branchName string, force bool, upstream string, args string, promptUserForCredential func(string) string) error {
followTagsFlag := "--follow-tags"
followsign, _ := c.getLocalGitConfig("push.followTags")
if followsign == "false" {
if c.GetConfigValue("push.followTags") == "false" {
followTagsFlag = ""
} else if followsign == "" {
followsign, _ = c.getGlobalGitConfig("push.followTags")
if followsign == "false" {
followTagsFlag = ""
}
}
forceFlag := ""