|
|
@ -25,11 +25,7 @@ func (repo *Repository) GetLanguageStats(commitID string) (map[string]int64, err |
|
|
|
defer cancel() |
|
|
|
defer cancel() |
|
|
|
|
|
|
|
|
|
|
|
writeID := func(id string) error { |
|
|
|
writeID := func(id string) error { |
|
|
|
_, err := batchStdinWriter.Write([]byte(id)) |
|
|
|
_, err := batchStdinWriter.Write([]byte(id + "\n")) |
|
|
|
if err != nil { |
|
|
|
|
|
|
|
return err |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
_, err = batchStdinWriter.Write([]byte{'\n'}) |
|
|
|
|
|
|
|
return err |
|
|
|
return err |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -85,10 +81,10 @@ func (repo *Repository) GetLanguageStats(commitID string) (map[string]int64, err |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
sizeToRead := size |
|
|
|
sizeToRead := size |
|
|
|
discard := int64(0) |
|
|
|
discard := int64(1) |
|
|
|
if size > fileSizeLimit { |
|
|
|
if size > fileSizeLimit { |
|
|
|
sizeToRead = fileSizeLimit |
|
|
|
sizeToRead = fileSizeLimit |
|
|
|
discard = size - fileSizeLimit |
|
|
|
discard = size - fileSizeLimit + 1 |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
_, err = contentBuf.ReadFrom(io.LimitReader(batchReader, sizeToRead)) |
|
|
|
_, err = contentBuf.ReadFrom(io.LimitReader(batchReader, sizeToRead)) |
|
|
|