aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--remote.go2
-rw-r--r--remote_test.go7
2 files changed, 8 insertions, 1 deletions
diff --git a/remote.go b/remote.go
index 2c8a731..3508ed9 100644
--- a/remote.go
+++ b/remote.go
@@ -51,7 +51,7 @@ func (r *Remote) Connect() error {
var err error
r.fetchSession, err = r.client.NewFetchPackSession(r.endpoint)
if err != nil {
- return nil
+ return err
}
return r.retrieveAdvertisedReferences()
diff --git a/remote_test.go b/remote_test.go
index acf646f..c3e86df 100644
--- a/remote_test.go
+++ b/remote_test.go
@@ -44,6 +44,13 @@ func (s *RemoteSuite) TestnewRemoteInvalidEndpoint(c *C) {
c.Assert(err, NotNil)
}
+func (s *RemoteSuite) TestnewRemoteNonExistentEndpoint(c *C) {
+ r := newRemote(nil, nil, &config.RemoteConfig{Name: "foo", URL: "ssh://non-existent/foo.git"})
+
+ err := r.Connect()
+ c.Assert(err, NotNil)
+}
+
func (s *RemoteSuite) TestnewRemoteInvalidSchemaEndpoint(c *C) {
r := newRemote(nil, nil, &config.RemoteConfig{Name: "foo", URL: "qux://foo"})