aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/transport/file
diff options
context:
space:
mode:
Diffstat (limited to 'plumbing/transport/file')
-rw-r--r--plumbing/transport/file/client.go17
1 files changed, 12 insertions, 5 deletions
diff --git a/plumbing/transport/file/client.go b/plumbing/transport/file/client.go
index d2a57d0..a199b01 100644
--- a/plumbing/transport/file/client.go
+++ b/plumbing/transport/file/client.go
@@ -3,6 +3,7 @@ package file
import (
"io"
+ "os"
"os/exec"
"gopkg.in/src-d/go-git.v4/plumbing/transport"
@@ -71,10 +72,16 @@ func (c *command) Close() error {
return nil
}
- return c.cmd.Process.Kill()
-}
-
-func (c *command) Wait() error {
defer func() { c.closed = true }()
- return c.cmd.Wait()
+ err := c.cmd.Wait()
+ if _, ok := err.(*os.PathError); ok {
+ return nil
+ }
+
+ // When a repository does not exist, the command exits with code 128.
+ if _, ok := err.(*exec.ExitError); ok {
+ return nil
+ }
+
+ return err
}