From c6349552c1c54ea114b92ae23fc840f68f6551f4 Mon Sep 17 00:00:00 2001 From: Máximo Cuadros Date: Sat, 31 Oct 2015 01:14:03 +0100 Subject: internal -> core --- clients/http/common.go | 5 +++-- clients/http/git_upload_pack.go | 7 ++++--- clients/http/git_upload_pack_test.go | 6 +++--- 3 files changed, 10 insertions(+), 8 deletions(-) (limited to 'clients/http') diff --git a/clients/http/common.go b/clients/http/common.go index 2a2808c..15338a8 100644 --- a/clients/http/common.go +++ b/clients/http/common.go @@ -5,6 +5,7 @@ import ( "net/http" "gopkg.in/src-d/go-git.v2/clients/common" + "gopkg.in/src-d/go-git.v2/core" ) type HTTPError struct { @@ -18,10 +19,10 @@ func NewHTTPError(r *http.Response) error { err := &HTTPError{r} if r.StatusCode == 404 || r.StatusCode == 401 { - return common.NewPermanentError(common.NotFoundErr) + return core.NewPermanentError(common.NotFoundErr) } - return common.NewUnexpectedError(err) + return core.NewUnexpectedError(err) } func (e *HTTPError) StatusCode() int { diff --git a/clients/http/git_upload_pack.go b/clients/http/git_upload_pack.go index 1c22dbf..bc99fd8 100644 --- a/clients/http/git_upload_pack.go +++ b/clients/http/git_upload_pack.go @@ -7,6 +7,7 @@ import ( "strings" "gopkg.in/src-d/go-git.v2/clients/common" + "gopkg.in/src-d/go-git.v2/core" "gopkg.in/src-d/go-git.v2/formats/pktline" ) @@ -50,7 +51,7 @@ func (s *GitUploadPackService) Fetch(r *common.GitUploadPackRequest) (io.ReadClo h := make([]byte, 8) if _, err := res.Body.Read(h); err != nil { - return nil, common.NewUnexpectedError(err) + return nil, core.NewUnexpectedError(err) } return res.Body, nil @@ -64,14 +65,14 @@ func (s *GitUploadPackService) doRequest(method, url string, content *strings.Re req, err := http.NewRequest(method, url, body) if err != nil { - return nil, common.NewPermanentError(err) + return nil, core.NewPermanentError(err) } s.applyHeadersToRequest(req, content) res, err := s.Client.Do(req) if err != nil { - return nil, common.NewUnexpectedError(err) + return nil, core.NewUnexpectedError(err) } if err := NewHTTPError(res); err != nil { diff --git a/clients/http/git_upload_pack_test.go b/clients/http/git_upload_pack_test.go index 7234766..c90a259 100644 --- a/clients/http/git_upload_pack_test.go +++ b/clients/http/git_upload_pack_test.go @@ -5,7 +5,7 @@ import ( . "gopkg.in/check.v1" "gopkg.in/src-d/go-git.v2/clients/common" - "gopkg.in/src-d/go-git.v2/internal" + "gopkg.in/src-d/go-git.v2/core" ) type SuiteRemote struct{} @@ -42,8 +42,8 @@ func (s *SuiteRemote) TestFetch(c *C) { c.Assert(r.Connect(RepositoryFixture), IsNil) reader, err := r.Fetch(&common.GitUploadPackRequest{ - Want: []internal.Hash{ - internal.NewHash("6ecf0ef2c2dffb796033e5a02219af86ec6584e5"), + Want: []core.Hash{ + core.NewHash("6ecf0ef2c2dffb796033e5a02219af86ec6584e5"), }, }) -- cgit