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

plumbing: use LookPath instead of Stat to fix Windows executables #554

Merged
merged 1 commit into from
Aug 28, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plumbing/transport/file/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion plumbing/transport/file/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down