aboutsummaryrefslogtreecommitdiffstats
path: root/utils/binary
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2016-11-08 23:46:38 +0100
committerGitHub <noreply@github.com>2016-11-08 23:46:38 +0100
commitac095bb12c4d29722b60ba9f20590fa7cfa6bc7d (patch)
tree223f36f336ba3414b1e45cac8af6c4744a5d7ef6 /utils/binary
parente523701393598f4fa241dd407af9ff8925507a1a (diff)
downloadgo-git-ac095bb12c4d29722b60ba9f20590fa7cfa6bc7d.tar.gz
new plumbing package (#118)
* plumbing: now core was renamed to core, and formats and clients moved inside
Diffstat (limited to 'utils/binary')
-rw-r--r--utils/binary/read.go10
-rw-r--r--utils/binary/read_test.go4
2 files changed, 7 insertions, 7 deletions
diff --git a/utils/binary/read.go b/utils/binary/read.go
index 90ae41f..8aab3e5 100644
--- a/utils/binary/read.go
+++ b/utils/binary/read.go
@@ -6,7 +6,7 @@ import (
"encoding/binary"
"io"
- "gopkg.in/src-d/go-git.v4/core"
+ "gopkg.in/src-d/go-git.v4/plumbing"
)
// Read reads structured binary data from r into data. Bytes are read and
@@ -113,11 +113,11 @@ func ReadUint16(r io.Reader) (uint16, error) {
return v, nil
}
-// ReadHash reads a core.Hash from r
-func ReadHash(r io.Reader) (core.Hash, error) {
- var h core.Hash
+// ReadHash reads a plumbing.Hash from r
+func ReadHash(r io.Reader) (plumbing.Hash, error) {
+ var h plumbing.Hash
if err := binary.Read(r, binary.BigEndian, h[:]); err != nil {
- return core.ZeroHash, err
+ return plumbing.ZeroHash, err
}
return h, nil
diff --git a/utils/binary/read_test.go b/utils/binary/read_test.go
index ad5ef29..59dbc30 100644
--- a/utils/binary/read_test.go
+++ b/utils/binary/read_test.go
@@ -6,7 +6,7 @@ import (
"testing"
. "gopkg.in/check.v1"
- "gopkg.in/src-d/go-git.v4/core"
+ "gopkg.in/src-d/go-git.v4/plumbing"
)
func Test(t *testing.T) { TestingT(t) }
@@ -76,7 +76,7 @@ func (s *BinarySuite) TestReadUint16(c *C) {
}
func (s *BinarySuite) TestReadHash(c *C) {
- expected := core.NewHash("43aec75c611f22c73b27ece2841e6ccca592f285")
+ expected := plumbing.NewHash("43aec75c611f22c73b27ece2841e6ccca592f285")
buf := bytes.NewBuffer(nil)
err := binary.Write(buf, binary.BigEndian, expected)
c.Assert(err, IsNil)