summaryrefslogtreecommitdiff
path: root/cmd.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd.go')
-rw-r--r--cmd.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/cmd.go b/cmd.go
index fca36cb..45cb18d 100644
--- a/cmd.go
+++ b/cmd.go
@@ -5,13 +5,18 @@ import (
"context"
"errors"
"os/exec"
+ "sync"
)
+var mut sync.Mutex
var gitbinpath string
func findbin() string {
if gitbinpath == "" {
+ mut.Lock()
gitbinpath, _ = exec.LookPath("git")
+ mut.Unlock()
+
if gitbinpath == "" {
panic("failed to find 'git' executable")
}