diff --git a/go.mod b/go.mod index 3bd51c6c..d4890c52 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ module github.com/git-lfs/git-lfs/v3 require ( github.com/avast/retry-go v2.4.2+incompatible github.com/dpotapov/go-spnego v0.0.0-20210315154721-298b63a54430 - github.com/git-lfs/gitobj/v2 v2.0.2 + github.com/git-lfs/gitobj/v2 v2.1.0 github.com/git-lfs/go-netrc v0.0.0-20210914205454-f0c862dd687a github.com/git-lfs/pktline v0.0.0-20210330133718-06e9096e2825 github.com/git-lfs/wildmatch/v2 v2.0.1 diff --git a/go.sum b/go.sum index 8abb768e..0b73d573 100644 --- a/go.sum +++ b/go.sum @@ -7,8 +7,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dpotapov/go-spnego v0.0.0-20210315154721-298b63a54430 h1:oempk9HjNt6rVKyKmpdnoN7XABQv3SXLWu3pxUI7Vlk= github.com/dpotapov/go-spnego v0.0.0-20210315154721-298b63a54430/go.mod h1:AVSs/gZKt1bOd2AhkhbS7Qh56Hv7klde22yXVbwYJhc= -github.com/git-lfs/gitobj/v2 v2.0.2 h1:p8rWlhEyiSsC+4Qc+EdufySatf8sDtvJIrHAHgf7Ar8= -github.com/git-lfs/gitobj/v2 v2.0.2/go.mod h1:q6aqxl6Uu3gWsip5GEKpw+7459F97er8COmU45ncAxw= +github.com/git-lfs/gitobj/v2 v2.1.0 h1:5BUDAMga0Sv9msMXolrn6xplkiG5RaVEkOir2HSznog= +github.com/git-lfs/gitobj/v2 v2.1.0/go.mod h1:q6aqxl6Uu3gWsip5GEKpw+7459F97er8COmU45ncAxw= github.com/git-lfs/go-netrc v0.0.0-20210914205454-f0c862dd687a h1:6pskVZacdMUL93pCpMAYnMDLjH1yDFhssPYGe32sjdk= github.com/git-lfs/go-netrc v0.0.0-20210914205454-f0c862dd687a/go.mod h1:70O4NAtvWn1jW8V8V+OKrJJYcxDLTmIozfi2fmSz5SI= github.com/git-lfs/pktline v0.0.0-20210330133718-06e9096e2825 h1:riQhgheTL7tMF4d5raz9t3+IzoR1i1wqxE1kZC6dY+U= diff --git a/vendor/github.com/git-lfs/gitobj/v2/tree.go b/vendor/github.com/git-lfs/gitobj/v2/tree.go index d4996ae6..ab10708d 100644 --- a/vendor/github.com/git-lfs/gitobj/v2/tree.go +++ b/vendor/github.com/git-lfs/gitobj/v2/tree.go @@ -115,22 +115,18 @@ func (t *Tree) Encode(to io.Writer) (n int, err error) { func (t *Tree) Merge(others ...*TreeEntry) *Tree { unseen := make(map[string]*TreeEntry) - // Build a cache of name+filemode to *TreeEntry. + // Build a cache of name to *TreeEntry. for _, other := range others { - key := fmt.Sprintf("%s\x00%o", other.Name, other.Filemode) - - unseen[key] = other + unseen[other.Name] = other } // Map the existing entries ("t.Entries") into a new set by either // copying an existing entry, or replacing it with a new one. entries := make([]*TreeEntry, 0, len(t.Entries)) for _, entry := range t.Entries { - key := fmt.Sprintf("%s\x00%o", entry.Name, entry.Filemode) - - if other, ok := unseen[key]; ok { + if other, ok := unseen[entry.Name]; ok { entries = append(entries, other) - delete(unseen, key) + delete(unseen, entry.Name) } else { oid := make([]byte, len(entry.Oid)) copy(oid, entry.Oid) @@ -234,6 +230,12 @@ func (e *TreeEntry) Type() ObjectType { } } +// IsLink returns true if the given TreeEntry is a blob which represents a +// symbolic link (i.e., with a filemode of 0120000. +func (e *TreeEntry) IsLink() bool { + return e.Filemode & sIFMT == sIFLNK +} + // SubtreeOrder is an implementation of sort.Interface that sorts a set of // `*TreeEntry`'s according to "subtree" order. This ordering is required to // write trees in a correct, readable format to the Git object database. diff --git a/vendor/modules.txt b/vendor/modules.txt index d7264eb1..f330680f 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -8,7 +8,7 @@ github.com/avast/retry-go github.com/davecgh/go-spew/spew # github.com/dpotapov/go-spnego v0.0.0-20210315154721-298b63a54430 github.com/dpotapov/go-spnego -# github.com/git-lfs/gitobj/v2 v2.0.2 +# github.com/git-lfs/gitobj/v2 v2.1.0 github.com/git-lfs/gitobj/v2 github.com/git-lfs/gitobj/v2/errors github.com/git-lfs/gitobj/v2/pack