diff options
author | Oleg Kovalov <iamolegkovalov@gmail.com> | 2020-07-01 20:51:24 +0200 |
---|---|---|
committer | Oleg Kovalov <iamolegkovalov@gmail.com> | 2020-07-01 20:51:24 +0200 |
commit | 27a034c7643768a4ad486a64e8a1b59fa3f8b3b4 (patch) | |
tree | 9d6e25bf60cbd0e1aabbba687f2655867f113c1e /plumbing/format/packfile | |
parent | 9ac753f4afb36feb1a1c22214c16e853db54aa00 (diff) | |
download | go-git-27a034c7643768a4ad486a64e8a1b59fa3f8b3b4.tar.gz |
fix goreportcard warnings
Diffstat (limited to 'plumbing/format/packfile')
-rw-r--r-- | plumbing/format/packfile/encoder_advanced_test.go | 4 | ||||
-rw-r--r-- | plumbing/format/packfile/encoder_test.go | 4 | ||||
-rw-r--r-- | plumbing/format/packfile/patch_delta.go | 3 |
3 files changed, 5 insertions, 6 deletions
diff --git a/plumbing/format/packfile/encoder_advanced_test.go b/plumbing/format/packfile/encoder_advanced_test.go index 21bf3ae..95db5c0 100644 --- a/plumbing/format/packfile/encoder_advanced_test.go +++ b/plumbing/format/packfile/encoder_advanced_test.go @@ -6,7 +6,6 @@ import ( "math/rand" "testing" - "github.com/go-git/go-billy/v5/memfs" "github.com/go-git/go-git/v5/plumbing" "github.com/go-git/go-git/v5/plumbing/cache" "github.com/go-git/go-git/v5/plumbing/format/idxfile" @@ -14,8 +13,9 @@ import ( "github.com/go-git/go-git/v5/plumbing/storer" "github.com/go-git/go-git/v5/storage/filesystem" + "github.com/go-git/go-billy/v5/memfs" + fixtures "github.com/go-git/go-git-fixtures/v4" . "gopkg.in/check.v1" - "github.com/go-git/go-git-fixtures/v4" ) type EncoderAdvancedSuite struct { diff --git a/plumbing/format/packfile/encoder_test.go b/plumbing/format/packfile/encoder_test.go index 2689762..d2db892 100644 --- a/plumbing/format/packfile/encoder_test.go +++ b/plumbing/format/packfile/encoder_test.go @@ -5,13 +5,13 @@ import ( "io" stdioutil "io/ioutil" - "github.com/go-git/go-billy/v5/memfs" "github.com/go-git/go-git/v5/plumbing" "github.com/go-git/go-git/v5/plumbing/format/idxfile" "github.com/go-git/go-git/v5/storage/memory" + "github.com/go-git/go-billy/v5/memfs" + fixtures "github.com/go-git/go-git-fixtures/v4" . "gopkg.in/check.v1" - "github.com/go-git/go-git-fixtures/v4" ) type EncoderSuite struct { diff --git a/plumbing/format/packfile/patch_delta.go b/plumbing/format/packfile/patch_delta.go index 1dc8b8b..9e90f30 100644 --- a/plumbing/format/packfile/patch_delta.go +++ b/plumbing/format/packfile/patch_delta.go @@ -49,7 +49,6 @@ func ApplyDelta(target, base plumbing.EncodedObject, delta []byte) (err error) { return err } - target.SetSize(int64(dst.Len())) b := byteSlicePool.Get().([]byte) @@ -113,7 +112,7 @@ func patchDelta(dst *bytes.Buffer, src, delta []byte) error { invalidOffsetSize(offset, sz, srcSz) { break } - dst.Write(src[offset:offset+sz]) + dst.Write(src[offset : offset+sz]) remainingTargetSz -= sz } else if isCopyFromDelta(cmd) { sz := uint(cmd) // cmd is the size itself |