@@ -120,8 +120,8 @@ type Commit struct {
120
120
121
121
// Parser sets values used in GitParse.
122
122
type Parser struct {
123
- maxDiffSize int
124
- maxCommitSize int
123
+ maxDiffSize int64
124
+ maxCommitSize int64
125
125
dateFormat string
126
126
127
127
useCustomContentWriter bool
@@ -188,7 +188,7 @@ func UseCustomContentWriter() Option {
188
188
189
189
// WithMaxDiffSize sets maxDiffSize option. Diffs larger than maxDiffSize will
190
190
// be truncated.
191
- func WithMaxDiffSize (maxDiffSize int ) Option {
191
+ func WithMaxDiffSize (maxDiffSize int64 ) Option {
192
192
return func (parser * Parser ) {
193
193
parser .maxDiffSize = maxDiffSize
194
194
}
@@ -197,7 +197,7 @@ func WithMaxDiffSize(maxDiffSize int) Option {
197
197
// WithMaxCommitSize sets maxCommitSize option. Commits larger than maxCommitSize
198
198
// will be put in the commit channel and additional diffs will be added to a
199
199
// new commit.
200
- func WithMaxCommitSize (maxCommitSize int ) Option {
200
+ func WithMaxCommitSize (maxCommitSize int64 ) Option {
201
201
return func (parser * Parser ) {
202
202
parser .maxCommitSize = maxCommitSize
203
203
}
@@ -210,8 +210,8 @@ type Option func(*Parser)
210
210
func NewParser (options ... Option ) * Parser {
211
211
parser := & Parser {
212
212
dateFormat : defaultDateFormat ,
213
- maxDiffSize : int ( defaultMaxDiffSize ) ,
214
- maxCommitSize : int ( defaultMaxCommitSize ) ,
213
+ maxDiffSize : defaultMaxDiffSize ,
214
+ maxCommitSize : defaultMaxCommitSize ,
215
215
}
216
216
for _ , option := range options {
217
217
option (parser )
@@ -572,7 +572,7 @@ func (c *Parser) FromReader(ctx context.Context, stdOut io.Reader, diffChan chan
572
572
latestState = ParseFailure
573
573
}
574
574
575
- if currentDiff .Len () > c .maxDiffSize {
575
+ if int64 ( currentDiff .Len () ) > c .maxDiffSize {
576
576
ctx .Logger ().V (2 ).Info (fmt .Sprintf (
577
577
"Diff for %s exceeded MaxDiffSize(%d)" , currentDiff .PathB , c .maxDiffSize ,
578
578
))
0 commit comments