From 67c3484b05f9e24876cd2b569fb06571515ecb35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20K=C3=A4ufl?= Date: Mon, 1 Jun 2015 20:53:08 +0200 Subject: [PATCH] Used .gitconfig in LocalWorkingDir instead of PWD --- git/git.go | 4 ++-- lfs/config.go | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/git/git.go b/git/git.go index 9e46bf7d..b069f888 100644 --- a/git/git.go +++ b/git/git.go @@ -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 diff --git a/lfs/config.go b/lfs/config.go index 288984ef..fdcdebc4 100644 --- a/lfs/config.go +++ b/lfs/config.go @@ -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)) }