Skip to content

Commit 3f543db

Browse files
Merge pull request #790 from ibuildthecloud/main
bug: check for git on mac by using xcode-select
2 parents c3e1974 + 071c5f2 commit 3f543db

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Diff for: pkg/repos/git/git_go.go

+8-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"fmt"
77
"os"
88
"os/exec"
9+
"runtime"
910
"sync"
1011

1112
"github.com/go-git/go-git/v5"
@@ -24,8 +25,13 @@ func usePureGo() bool {
2425
return true
2526
}
2627
gitCheck.Do(func() {
27-
_, err := exec.LookPath("git")
28-
externalGit = err == nil
28+
if runtime.GOOS == "darwin" {
29+
if exec.Command("xcode-select", "-p").Run() == nil {
30+
externalGit = true
31+
}
32+
} else if _, err := exec.LookPath("git"); err == nil {
33+
externalGit = true
34+
}
2935
})
3036
return !externalGit
3137
}

0 commit comments

Comments
 (0)