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

Commit bff1d06

Browse files
authored
Merge pull request #554 from strib/strib/fix-win-cmd-lookup
plumbing: use LookPath instead of Stat to fix Windows executables
2 parents 96286b0 + aad08e6 commit bff1d06

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
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
}

plumbing/transport/file/client_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func (s *ClientSuite) TestCommand(c *C) {
3333

3434
// Make sure we get an error for one that doesn't exist.
3535
_, err = runner.Command("git-fake-command", ep, emptyAuth)
36-
c.Assert(os.IsNotExist(err), Equals, true)
36+
c.Assert(err, NotNil)
3737
}
3838

3939
const bareConfig = `[core]

0 commit comments

Comments
 (0)