diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2016-01-27 12:07:36 +0100 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2016-01-27 12:07:36 +0100 |
commit | 35ee4d749be21691b78a7465361ad47179fe2eff (patch) | |
tree | d1d7f66e22b60cb1e3654cec11d417742d3659e4 /formats/packfile/reader.go | |
parent | f39e08f31be9df1620b751e93ed84c87de2b4e86 (diff) | |
parent | 4c897413b26c18c3a24c667b1bddaaffda7e098e (diff) | |
download | go-git-35ee4d749be21691b78a7465361ad47179fe2eff.tar.gz |
Merge pull request #17 from alcortesm/fix-zlib-invalid-headerv2.1.3
fix zlib invalid header error
Diffstat (limited to 'formats/packfile/reader.go')
-rw-r--r-- | formats/packfile/reader.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/formats/packfile/reader.go b/formats/packfile/reader.go index 37918b1..959e411 100644 --- a/formats/packfile/reader.go +++ b/formats/packfile/reader.go @@ -98,7 +98,7 @@ func (r *Reader) Read(s core.ObjectStorage) (int64, error) { func (r *Reader) validateHeader() error { var header = make([]byte, 4) - if _, err := r.r.Read(header); err != nil { + if _, err := io.ReadFull(r.r, header); err != nil { return err } @@ -127,7 +127,6 @@ func (r *Reader) readObjects(count uint32) error { start := r.r.position obj, err := r.newRAWObject() if err != nil && err != io.EOF { - fmt.Println(err) return err } @@ -188,7 +187,7 @@ func (r *Reader) newRAWObject() (core.Object, error) { func (r *Reader) readREFDelta(raw core.Object) error { var ref core.Hash - if _, err := r.r.Read(ref[:]); err != nil { + if _, err := io.ReadFull(r.r, ref[:]); err != nil { return err } |