aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2017-08-28 09:46:38 +0200
committerGitHub <noreply@github.com>2017-08-28 09:46:38 +0200
commitbff1d06e40f70566a779880b2edeb53ad1930609 (patch)
tree5c221fb52f4bf4b99543a0183f19b4c28f05f6b8 /plumbing
parent96286b0a0a051bd4f55d625c64ca239978908d5d (diff)
parentaad08e631b47fb9590a5102159794db42ac4dade (diff)
downloadgo-git-bff1d06e40f70566a779880b2edeb53ad1930609.tar.gz
Merge pull request #554 from strib/strib/fix-win-cmd-lookup
plumbing: use LookPath instead of Stat to fix Windows executables
Diffstat (limited to 'plumbing')
-rw-r--r--plumbing/transport/file/client.go2
-rw-r--r--plumbing/transport/file/client_test.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/plumbing/transport/file/client.go b/plumbing/transport/file/client.go
index af4a88b..d229fdd 100644
--- a/plumbing/transport/file/client.go
+++ b/plumbing/transport/file/client.go
@@ -66,7 +66,7 @@ func prefixExecPath(cmd string) (string, error) {
cmd = filepath.Join(execPath, cmd)
// Make sure it actually exists.
- _, err = os.Stat(cmd)
+ _, err = exec.LookPath(cmd)
if err != nil {
return "", err
}
diff --git a/plumbing/transport/file/client_test.go b/plumbing/transport/file/client_test.go
index 3532a4c..864cddc 100644
--- a/plumbing/transport/file/client_test.go
+++ b/plumbing/transport/file/client_test.go
@@ -33,7 +33,7 @@ func (s *ClientSuite) TestCommand(c *C) {
// Make sure we get an error for one that doesn't exist.
_, err = runner.Command("git-fake-command", ep, emptyAuth)
- c.Assert(os.IsNotExist(err), Equals, true)
+ c.Assert(err, NotNil)
}
const bareConfig = `[core]