aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/format/index
diff options
context:
space:
mode:
Diffstat (limited to 'plumbing/format/index')
-rw-r--r--plumbing/format/index/decoder.go4
-rw-r--r--plumbing/format/index/decoder_test.go2
-rw-r--r--plumbing/format/index/encoder_test.go3
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) {