diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2020-07-06 01:52:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-06 01:52:08 +0200 |
commit | a9899594dfdde8bbfdf35fc7e8c2fc3ec5aa7fdb (patch) | |
tree | e7b28b456ef3ed90eafc026b506786bea5df179e /plumbing/format/index | |
parent | 9ac753f4afb36feb1a1c22214c16e853db54aa00 (diff) | |
parent | f9cf9a99fd51bff8e002900a3a73d117ba54c887 (diff) | |
download | go-git-a9899594dfdde8bbfdf35fc7e8c2fc3ec5aa7fdb.tar.gz |
Merge pull request #117 from cristaloleg/fix-goreportcard
fix goreportcard warnings
Diffstat (limited to 'plumbing/format/index')
-rw-r--r-- | plumbing/format/index/decoder.go | 4 | ||||
-rw-r--r-- | plumbing/format/index/decoder_test.go | 2 | ||||
-rw-r--r-- | plumbing/format/index/encoder_test.go | 3 |
3 files changed, 6 insertions, 3 deletions
diff --git a/plumbing/format/index/decoder.go b/plumbing/format/index/decoder.go index 79d0b9e..d341d59 100644 --- a/plumbing/format/index/decoder.go +++ b/plumbing/format/index/decoder.go @@ -390,7 +390,9 @@ func (d *treeExtensionDecoder) readEntry() (*TreeEntry, error) { e.Trees = i _, err = io.ReadFull(d.r, e.Hash[:]) - + if err != nil { + return nil, err + } return e, nil } diff --git a/plumbing/format/index/decoder_test.go b/plumbing/format/index/decoder_test.go index 4e47dde..39ab336 100644 --- a/plumbing/format/index/decoder_test.go +++ b/plumbing/format/index/decoder_test.go @@ -6,8 +6,8 @@ import ( "github.com/go-git/go-git/v5/plumbing" "github.com/go-git/go-git/v5/plumbing/filemode" + fixtures "github.com/go-git/go-git-fixtures/v4" . "gopkg.in/check.v1" - "github.com/go-git/go-git-fixtures/v4" ) func Test(t *testing.T) { TestingT(t) } diff --git a/plumbing/format/index/encoder_test.go b/plumbing/format/index/encoder_test.go index 17585a0..b7a73cb 100644 --- a/plumbing/format/index/encoder_test.go +++ b/plumbing/format/index/encoder_test.go @@ -5,9 +5,10 @@ import ( "strings" "time" + "github.com/go-git/go-git/v5/plumbing" + "github.com/google/go-cmp/cmp" . "gopkg.in/check.v1" - "github.com/go-git/go-git/v5/plumbing" ) func (s *IndexSuite) TestEncode(c *C) { |