vendor: vendor gitobj v2.0.1

This commit is contained in:
brian m. carlson 2020-12-17 22:51:44 +00:00
parent 3cd8d8e94a
commit b8a2cda48b
No known key found for this signature in database
GPG Key ID: 2D0C9BC12F82B3A1
8 changed files with 13 additions and 7 deletions

4
vendor/github.com/git-lfs/gitobj/v2/SECURITY.md generated vendored Normal file

@ -0,0 +1,4 @@
Please see
[SECURITY.md](https://github.com/git-lfs/git-lfs/blob/master/SECURITY.md)
in the main Git LFS repository for information on how to report security
vulnerabilities in this package.

@ -97,7 +97,7 @@ func (c *Commit) Decode(hash hash.Hash, from io.Reader, size int64) (n int, err
var messageParts []string
s := bufio.NewScanner(from)
s.Buffer(nil, 1024*1024)
s.Buffer(nil, 10*1024*1024)
for s.Scan() {
text := s.Text()
n = n + len(text+"\n")

@ -7,7 +7,7 @@ import (
"io"
)
const maxHashSize = sha256.Size
const MaxHashSize = sha256.Size
// Index stores information about the location of objects in a corresponding
// packfile.

@ -13,7 +13,7 @@ type V1 struct {
// Name implements IndexVersion.Name by returning the 20 byte SHA-1 object name
// for the given entry at offset "at" in the v1 index file "idx".
func (v *V1) Name(idx *Index, at int64) ([]byte, error) {
var sha [maxHashSize]byte
var sha [MaxHashSize]byte
hashlen := v.hash.Size()

@ -13,7 +13,7 @@ type V2 struct {
// Name implements IndexVersion.Name by returning the 20 byte SHA-1 object name
// for the given entry at offset "at" in the v2 index file "idx".
func (v *V2) Name(idx *Index, at int64) ([]byte, error) {
var sha [maxHashSize]byte
var sha [MaxHashSize]byte
hashlen := v.hash.Size()

@ -190,7 +190,7 @@ func (p *Packfile) findBase(typ PackedObjectType, offset, objOffset int64) (Chai
// We assume that we have to read at least an object ID's worth (the
// hash length in the case of a OBJ_REF_DELTA, or greater than the
// length of the base offset encoded in an OBJ_OFS_DELTA).
var sha [32]byte
var sha [MaxHashSize]byte
if _, err := p.r.ReadAt(sha[:hashlen], offset); err != nil {
return nil, baseOffset, err
}

@ -10,6 +10,8 @@ import (
"strconv"
"strings"
"syscall"
"github.com/git-lfs/gitobj/v2/pack"
)
// Tree encapsulates a Git tree object.
@ -53,7 +55,7 @@ func (t *Tree) Decode(hash hash.Hash, from io.Reader, size int64) (n int, err er
n += len(fname)
fname = strings.TrimSuffix(fname, "\x00")
var sha [32]byte
var sha [pack.MaxHashSize]byte
if _, err = io.ReadFull(buf, sha[:hashlen]); err != nil {
return n, err
}

2
vendor/modules.txt vendored

@ -8,7 +8,7 @@ github.com/avast/retry-go
github.com/davecgh/go-spew/spew
# github.com/dpotapov/go-spnego v0.0.0-20190506202455-c2c609116ad0
github.com/dpotapov/go-spnego
# github.com/git-lfs/gitobj/v2 v2.0.0
# github.com/git-lfs/gitobj/v2 v2.0.1
github.com/git-lfs/gitobj/v2
github.com/git-lfs/gitobj/v2/errors
github.com/git-lfs/gitobj/v2/pack