diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2016-09-08 23:58:41 +0200 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2016-09-08 23:58:41 +0200 |
commit | 3b1baea2dd9353f42b3a9d93f6bc92ecbe9f4f01 (patch) | |
tree | d255b7e6edbcbaba1f98cf0c666a82c0f9750019 /formats/idxfile/decoder.go | |
parent | 2293a3dbda0a96f5cbac851bb73e1e675417e4f3 (diff) | |
download | go-git-3b1baea2dd9353f42b3a9d93f6bc92ecbe9f4f01.tar.gz |
format: packfile based on ObjectStorage and CRC32 calculation
Diffstat (limited to 'formats/idxfile/decoder.go')
-rw-r--r-- | formats/idxfile/decoder.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/formats/idxfile/decoder.go b/formats/idxfile/decoder.go index 9cd249d..617c0f4 100644 --- a/formats/idxfile/decoder.go +++ b/formats/idxfile/decoder.go @@ -4,6 +4,7 @@ import ( "bytes" "encoding/binary" "errors" + "fmt" "io" "gopkg.in/src-d/go-git.v4/core" @@ -95,7 +96,7 @@ func readFanout(idx *Idxfile, r io.Reader) error { } idx.ObjectCount, err = readInt32(r) - + fmt.Println(idx.ObjectCount) return err } @@ -116,7 +117,7 @@ func readObjectNames(idx *Idxfile, r io.Reader) error { func readCRC32(idx *Idxfile, r io.Reader) error { c := int(idx.ObjectCount) for i := 0; i < c; i++ { - if _, err := r.Read(idx.Entries[i].CRC32[:]); err != nil { + if err := binary.Read(r, binary.BigEndian, &idx.Entries[i].CRC32); err != nil { return err } } |