6
0
mirror of https://github.com/grdl/git-get.git synced 2026-02-04 16:14:48 +00:00

Fix problems with loading values from gitconfig

This commit is contained in:
Grzegorz Dlugoszewski
2020-06-30 21:25:42 +02:00
parent aee6d8209b
commit d964158bf7
5 changed files with 31 additions and 37 deletions

View File

@@ -9,7 +9,7 @@ type ConfigGlobal struct{}
// Get reads a value from global gitconfig file. Returns empty string when key is missing.
func (c *ConfigGlobal) Get(key string) string {
out, err := run.Git("config", "--global").AndCaptureLine()
out, err := run.Git("config", "--global", key).AndCaptureLine()
// In case of error return an empty string, the missing value will fall back to a default.
if err != nil {
return ""