From b69dff172c14fcbe0bc1fd1b50e63803cc4e1b49 Mon Sep 17 00:00:00 2001 From: Corey Johnson Date: Wed, 16 Oct 2019 16:26:32 -0700 Subject: [PATCH] Remove caching I removed this because it was making tests fail! --- git/git.go | 7 ------- 1 file changed, 7 deletions(-) diff --git a/git/git.go b/git/git.go index 25a1e2b24..b9585024c 100644 --- a/git/git.go +++ b/git/git.go @@ -10,13 +10,7 @@ import ( "strings" ) -var cachedDir string - func Dir() (string, error) { - if cachedDir != "" { - return cachedDir, nil - } - dirCmd := exec.Command("git", "rev-parse", "-q", "--git-dir") dirCmd.Stderr = nil output, err := dirCmd.Output() @@ -33,7 +27,6 @@ func Dir() (string, error) { gitDir = filepath.Clean(gitDir) } - cachedDir = gitDir return gitDir, nil }