Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

Commit 3eec53c

Browse files
committed
plumbing: use LookPath instead of Stat to fix Windows executables
When git-core isn't in the user's PATH, we need to use `LookPath` to verify the existence of the executable, rather than `os.Stat`, so that on Windows it will search for files with executable suffixes.
1 parent bd81c1f commit 3eec53c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

plumbing/transport/file/client.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ func prefixExecPath(cmd string) (string, error) {
6666
cmd = filepath.Join(execPath, cmd)
6767

6868
// Make sure it actually exists.
69-
_, err = os.Stat(cmd)
69+
_, err = exec.LookPath(cmd)
7070
if err != nil {
7171
return "", err
7272
}

0 commit comments

Comments
 (0)