aboutsummaryrefslogtreecommitdiffstats
path: root/clients/http
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2015-10-31 01:14:03 +0100
committerMáximo Cuadros <mcuadros@gmail.com>2015-10-31 01:14:03 +0100
commitc6349552c1c54ea114b92ae23fc840f68f6551f4 (patch)
tree6fbaf514ae9caf8241a0b9dfc3709d60942876c5 /clients/http
parentfe1fc1aa7dca3e0f6e54ab17f0acfa45f269e58c (diff)
downloadgo-git-c6349552c1c54ea114b92ae23fc840f68f6551f4.tar.gz
internal -> core
Diffstat (limited to 'clients/http')
-rw-r--r--clients/http/common.go5
-rw-r--r--clients/http/git_upload_pack.go7
-rw-r--r--clients/http/git_upload_pack_test.go6
3 files changed, 10 insertions, 8 deletions
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"),
},
})