aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/transport/file
diff options
context:
space:
mode:
authorSantiago M. Mola <santi@mola.io>2017-06-13 16:01:06 +0200
committerGitHub <noreply@github.com>2017-06-13 16:01:06 +0200
commitbeab77aaed6ac84cbf97704f5507eae40350fefa (patch)
tree25905da2442b2363d0d45bba07485543e5665deb /plumbing/transport/file
parent2a00316b65585be2bf68e1ea9c0e42c6af4f5679 (diff)
parentcbbd2a9ad8ee990c79bd847b0df2823e2449ea4e (diff)
downloadgo-git-beab77aaed6ac84cbf97704f5507eae40350fefa.tar.gz
Merge pull request #418 from smola/ssh-issue-310
fix push on git and ssh
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
}