summaryrefslogtreecommitdiffstats
path: root/pkg/commands/config.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2020-11-25 08:52:00 +1100
committerJesse Duffield <jessedduffield@gmail.com>2020-11-28 10:45:30 +1100
commit999e170f1d17b652dad231f1cbde6ab4bbeae8c7 (patch)
tree3a7ea186c3b868661242731a029dce3df396de1e /pkg/commands/config.go
parent7513bfb13a48c566e9ab0c31e259ea73d562c292 (diff)
standardise how we read from the config
Diffstat (limited to 'pkg/commands/config.go')
-rw-r--r--pkg/commands/config.go13
1 files changed, 8 insertions, 5 deletions
diff --git a/pkg/commands/config.go b/pkg/commands/config.go
index 4e747e32c..12bef33fd 100644
--- a/pkg/commands/config.go
+++ b/pkg/commands/config.go
@@ -43,10 +43,13 @@ func (c *GitCommand) colorArg() string {
}
func (c *GitCommand) GetConfigValue(key string) string {
- output, err := c.OSCommand.RunCommandWithOutput("git config --get %s", key)
- if err != nil {
- // looks like this returns an error if there is no matching value which we're okay with
- return ""
+ value, _ := c.getLocalGitConfig(key)
+ // we get an error if the key doesn't exist which we don't care about
+
+ if value != "" {
+ return value
}
- return strings.TrimSpace(output)
+
+ value, _ = c.getGlobalGitConfig(key)
+ return value
}