aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/transport/file
diff options
context:
space:
mode:
authorSantiago M. Mola <santi@mola.io>2017-06-13 14:23:15 +0200
committerSantiago M. Mola <santi@mola.io>2017-06-13 15:39:49 +0200
commitcbbd2a9ad8ee990c79bd847b0df2823e2449ea4e (patch)
tree25905da2442b2363d0d45bba07485543e5665deb /plumbing/transport/file
parent4b2d9b42bf18556bc51434e7221927c681bce746 (diff)
downloadgo-git-cbbd2a9ad8ee990c79bd847b0df2823e2449ea4e.tar.gz
transport/internal: remove Wait function, use Close directly
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
}