Skip to content

Commit a989959

Browse files
authored
Merge pull request go-git#117 from cristaloleg/fix-goreportcard
fix goreportcard warnings
2 parents 9ac753f + f9cf9a9 commit a989959

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+93
-75
lines changed

blame_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import (
44
"github.com/go-git/go-git/v5/plumbing"
55
"github.com/go-git/go-git/v5/plumbing/object"
66

7+
fixtures "github.com/go-git/go-git-fixtures/v4"
78
. "gopkg.in/check.v1"
8-
"github.com/go-git/go-git-fixtures/v4"
99
)
1010

1111
type BlameSuite struct {

config/branch_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
package config
22

33
import (
4-
. "gopkg.in/check.v1"
54
"github.com/go-git/go-git/v5/plumbing"
5+
6+
. "gopkg.in/check.v1"
67
)
78

89
type BranchSuite struct{}

internal/revision/parser_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ func (s *ParserSuite) TestParseWithValidExpression(c *C) {
9696
TildePath{3},
9797
},
9898
"@{2016-12-16T21:42:47Z}": []Revisioner{AtDate{tim}},
99-
"@{1}": []Revisioner{AtReflog{1}},
100-
"@{-1}": []Revisioner{AtCheckout{1}},
99+
"@{1}": []Revisioner{AtReflog{1}},
100+
"@{-1}": []Revisioner{AtCheckout{1}},
101101
"master@{upstream}": []Revisioner{
102102
Ref("master"),
103103
AtUpstream{},
@@ -211,12 +211,12 @@ func (s *ParserSuite) TestParseAtWithValidExpression(c *C) {
211211
tim, _ := time.Parse("2006-01-02T15:04:05Z", "2016-12-16T21:42:47Z")
212212

213213
datas := map[string]Revisioner{
214-
"": Ref("HEAD"),
215-
"{1}": AtReflog{1},
216-
"{-1}": AtCheckout{1},
217-
"{push}": AtPush{},
218-
"{upstream}": AtUpstream{},
219-
"{u}": AtUpstream{},
214+
"": Ref("HEAD"),
215+
"{1}": AtReflog{1},
216+
"{-1}": AtCheckout{1},
217+
"{push}": AtPush{},
218+
"{upstream}": AtUpstream{},
219+
"{u}": AtUpstream{},
220220
"{2016-12-16T21:42:47Z}": AtDate{tim},
221221
}
222222

plumbing/format/commitgraph/commitgraph_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ import (
66
"path"
77
"testing"
88

9-
. "gopkg.in/check.v1"
10-
fixtures "github.com/go-git/go-git-fixtures/v4"
119
"github.com/go-git/go-git/v5/plumbing"
1210
"github.com/go-git/go-git/v5/plumbing/format/commitgraph"
11+
12+
fixtures "github.com/go-git/go-git-fixtures/v4"
13+
. "gopkg.in/check.v1"
1314
)
1415

1516
func Test(t *testing.T) { TestingT(t) }

plumbing/format/idxfile/encoder_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import (
66

77
. "github.com/go-git/go-git/v5/plumbing/format/idxfile"
88

9+
fixtures "github.com/go-git/go-git-fixtures/v4"
910
. "gopkg.in/check.v1"
10-
"github.com/go-git/go-git-fixtures/v4"
1111
)
1212

1313
func (s *IdxfileSuite) TestDecodeEncode(c *C) {

plumbing/format/idxfile/idxfile_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import (
1010
"github.com/go-git/go-git/v5/plumbing"
1111
"github.com/go-git/go-git/v5/plumbing/format/idxfile"
1212

13+
fixtures "github.com/go-git/go-git-fixtures/v4"
1314
. "gopkg.in/check.v1"
14-
"github.com/go-git/go-git-fixtures/v4"
1515
)
1616

1717
func BenchmarkFindOffset(b *testing.B) {

plumbing/format/idxfile/writer_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import (
99
"github.com/go-git/go-git/v5/plumbing/format/idxfile"
1010
"github.com/go-git/go-git/v5/plumbing/format/packfile"
1111

12+
fixtures "github.com/go-git/go-git-fixtures/v4"
1213
. "gopkg.in/check.v1"
13-
"github.com/go-git/go-git-fixtures/v4"
1414
)
1515

1616
type WriterSuite struct {

plumbing/format/index/decoder.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,9 @@ func (d *treeExtensionDecoder) readEntry() (*TreeEntry, error) {
390390

391391
e.Trees = i
392392
_, err = io.ReadFull(d.r, e.Hash[:])
393-
393+
if err != nil {
394+
return nil, err
395+
}
394396
return e, nil
395397
}
396398

plumbing/format/index/decoder_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import (
66
"github.com/go-git/go-git/v5/plumbing"
77
"github.com/go-git/go-git/v5/plumbing/filemode"
88

9+
fixtures "github.com/go-git/go-git-fixtures/v4"
910
. "gopkg.in/check.v1"
10-
"github.com/go-git/go-git-fixtures/v4"
1111
)
1212

1313
func Test(t *testing.T) { TestingT(t) }

plumbing/format/index/encoder_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ import (
55
"strings"
66
"time"
77

8+
"github.com/go-git/go-git/v5/plumbing"
9+
810
"github.com/google/go-cmp/cmp"
911
. "gopkg.in/check.v1"
10-
"github.com/go-git/go-git/v5/plumbing"
1112
)
1213

1314
func (s *IndexSuite) TestEncode(c *C) {

0 commit comments

Comments
 (0)