Used .gitconfig in LocalWorkingDir instead of PWD

This commit is contained in:
Michael Käufl 2015-06-01 20:53:08 +02:00
parent 6e0e7ab946
commit 67c3484b05
2 changed files with 5 additions and 3 deletions

@ -93,8 +93,8 @@ func (c *gitConfig) List() (string, error) {
}
// ListFromFile lists all of the git config values in the given config file
func (c *gitConfig) ListFromFile() (string, error) {
return simpleExec(nil, "git", "config", "-l", "-f", ".gitconfig")
func (c *gitConfig) ListFromFile(f string) (string, error) {
return simpleExec(nil, "git", "config", "-l", "-f", f)
}
// Version returns the git version

@ -6,6 +6,7 @@ import (
"net/url"
"os"
"path"
"path/filepath"
"regexp"
"strconv"
"strings"
@ -183,7 +184,8 @@ func (c *Configuration) loadGitConfig() {
panic(fmt.Errorf("Error listing git config: %s", err))
}
fileOutput, err := git.Config.ListFromFile()
configFile := filepath.Join(LocalWorkingDir, ".gitconfig")
fileOutput, err := git.Config.ListFromFile(configFile)
if err != nil {
panic(fmt.Errorf("Error listing git config from file: %s", err))
}