Skip to content

Commit eebad26

Browse files
Merge branch 'main' into fix/neutrinoapi-detector-test
2 parents 6226113 + ccab741 commit eebad26

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ require (
102102
go.uber.org/zap v1.27.0
103103
golang.org/x/crypto v0.31.0
104104
golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67
105-
golang.org/x/net v0.32.0
105+
golang.org/x/net v0.33.0
106106
golang.org/x/oauth2 v0.24.0
107107
golang.org/x/sync v0.10.0
108108
golang.org/x/text v0.21.0

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -954,6 +954,8 @@ golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
954954
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
955955
golang.org/x/net v0.32.0 h1:ZqPmj8Kzc+Y6e0+skZsuACbx+wzMgo5MQsJh9Qd6aYI=
956956
golang.org/x/net v0.32.0/go.mod h1:CwU0IoeOlnQQWJ6ioyFrfRuomB8GKF6KbYXZVyeXNfs=
957+
golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I=
958+
golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4=
957959
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
958960
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
959961
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=

pkg/gitparse/gitparse.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ type Commit struct {
120120

121121
// Parser sets values used in GitParse.
122122
type Parser struct {
123-
maxDiffSize int
124-
maxCommitSize int
123+
maxDiffSize int64
124+
maxCommitSize int64
125125
dateFormat string
126126

127127
useCustomContentWriter bool
@@ -188,7 +188,7 @@ func UseCustomContentWriter() Option {
188188

189189
// WithMaxDiffSize sets maxDiffSize option. Diffs larger than maxDiffSize will
190190
// be truncated.
191-
func WithMaxDiffSize(maxDiffSize int) Option {
191+
func WithMaxDiffSize(maxDiffSize int64) Option {
192192
return func(parser *Parser) {
193193
parser.maxDiffSize = maxDiffSize
194194
}
@@ -197,7 +197,7 @@ func WithMaxDiffSize(maxDiffSize int) Option {
197197
// WithMaxCommitSize sets maxCommitSize option. Commits larger than maxCommitSize
198198
// will be put in the commit channel and additional diffs will be added to a
199199
// new commit.
200-
func WithMaxCommitSize(maxCommitSize int) Option {
200+
func WithMaxCommitSize(maxCommitSize int64) Option {
201201
return func(parser *Parser) {
202202
parser.maxCommitSize = maxCommitSize
203203
}
@@ -210,8 +210,8 @@ type Option func(*Parser)
210210
func NewParser(options ...Option) *Parser {
211211
parser := &Parser{
212212
dateFormat: defaultDateFormat,
213-
maxDiffSize: int(defaultMaxDiffSize),
214-
maxCommitSize: int(defaultMaxCommitSize),
213+
maxDiffSize: defaultMaxDiffSize,
214+
maxCommitSize: defaultMaxCommitSize,
215215
}
216216
for _, option := range options {
217217
option(parser)
@@ -572,7 +572,7 @@ func (c *Parser) FromReader(ctx context.Context, stdOut io.Reader, diffChan chan
572572
latestState = ParseFailure
573573
}
574574

575-
if currentDiff.Len() > c.maxDiffSize {
575+
if int64(currentDiff.Len()) > c.maxDiffSize {
576576
ctx.Logger().V(2).Info(fmt.Sprintf(
577577
"Diff for %s exceeded MaxDiffSize(%d)", currentDiff.PathB, c.maxDiffSize,
578578
))

pkg/gitparse/gitparse_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1452,7 +1452,7 @@ func TestMaxDiffSize(t *testing.T) {
14521452
builder.WriteString(singleCommitSingleDiff)
14531453

14541454
// Generate a diff that is larger than the maxDiffSize.
1455-
for i := 0; i <= parser.maxDiffSize/1024+10; i++ {
1455+
for i := int64(0); i <= parser.maxDiffSize/1024+10; i++ {
14561456
builder.WriteString("+" + strings.Repeat("0", 1024) + "\n")
14571457
}
14581458
bigReader := strings.NewReader(builder.String())
@@ -1467,7 +1467,7 @@ func TestMaxDiffSize(t *testing.T) {
14671467

14681468
select {
14691469
case diff := <-diffChan:
1470-
if diff.Len() > parser.maxDiffSize+1024 {
1470+
if int64(diff.Len()) > parser.maxDiffSize+1024 {
14711471
t.Errorf("diff did not match MaxDiffSize. Got: %d, expected (max): %d", diff.Len(), parser.maxDiffSize+1024)
14721472
}
14731473
case <-ctx.Done():

0 commit comments

Comments
 (0)