diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-11-25 08:52:00 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2020-11-28 10:45:30 +1100 |
commit | 999e170f1d17b652dad231f1cbde6ab4bbeae8c7 (patch) | |
tree | 3a7ea186c3b868661242731a029dce3df396de1e /pkg/commands/sync.go | |
parent | 7513bfb13a48c566e9ab0c31e259ea73d562c292 (diff) |
standardise how we read from the config
Diffstat (limited to 'pkg/commands/sync.go')
-rw-r--r-- | pkg/commands/sync.go | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/pkg/commands/sync.go b/pkg/commands/sync.go index 6f2c6207e..97a6e4748 100644 --- a/pkg/commands/sync.go +++ b/pkg/commands/sync.go @@ -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 := "" |