aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/transport/file/client.go
diff options
context:
space:
mode:
Diffstat (limited to 'plumbing/transport/file/client.go')
-rw-r--r--plumbing/transport/file/client.go15
1 files changed, 6 insertions, 9 deletions
diff --git a/plumbing/transport/file/client.go b/plumbing/transport/file/client.go
index 5484009..e3f7681 100644
--- a/plumbing/transport/file/client.go
+++ b/plumbing/transport/file/client.go
@@ -28,13 +28,18 @@ func NewClient(uploadPackBin, receivePackBin string) transport.Transport {
})
}
-func (r *runner) Command(cmd string, ep transport.Endpoint) (common.Command, error) {
+func (r *runner) Command(cmd string, ep transport.Endpoint, auth transport.AuthMethod) (common.Command, error) {
switch cmd {
case transport.UploadPackServiceName:
cmd = r.UploadPackBin
case transport.ReceivePackServiceName:
cmd = r.ReceivePackBin
}
+
+ if _, err := exec.LookPath(cmd); err != nil {
+ return nil, err
+ }
+
return &command{cmd: exec.Command(cmd, ep.Path)}, nil
}
@@ -43,14 +48,6 @@ type command struct {
closed bool
}
-func (c *command) SetAuth(auth transport.AuthMethod) error {
- if auth != nil {
- return transport.ErrInvalidAuthMethod
- }
-
- return nil
-}
-
func (c *command) Start() error {
return c.cmd.Start()
}