diff options
Diffstat (limited to 'utils')
-rw-r--r-- | utils/binary/read.go | 10 | ||||
-rw-r--r-- | utils/binary/read_test.go | 4 |
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) |