1
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2025-03-16 00:00:05 +01:00

Updating to latest version of kurin/blazer, which eliminates need to fetch attributes to get name.

This commit is contained in:
Joe Turgeon 2016-12-18 17:00:59 -06:00
parent fce667a905
commit 4157af999f
No known key found for this signature in database
GPG key ID: 7B63B97D65DC695F
3 changed files with 8 additions and 8 deletions

View file

@ -221,18 +221,13 @@ func (be *b2) List(t restic.FileType, done <-chan struct{}) <-chan string {
return
}
for _, obj := range objs {
info, err := obj.Attrs(be.context)
if err != nil {
continue
}
// Skip objects returned that do not have the specified prefix.
if !strings.HasPrefix(info.Name, prefix) {
if !strings.HasPrefix(obj.Name(), prefix) {
continue
}
// Remove the prefix from returned names.
m := strings.TrimPrefix(info.Name, prefix)
m := strings.TrimPrefix(obj.Name(), prefix)
if m == "" {
continue
}

2
vendor/manifest vendored
View file

@ -34,7 +34,7 @@
{
"importpath": "github.com/kurin/blazer",
"repository": "https://github.com/kurin/blazer",
"revision": "b1c2abe264719d4d2062dbeb10d17d5de28d26ca",
"revision": "fff096e261374c464c633ef70b264f5e9651b091",
"branch": "master"
},
{

View file

@ -155,6 +155,11 @@ type Attrs struct {
Info map[string]string // Save arbitrary metadata on upload, but limited to 10 keys.
}
// Name returns an object's name
func (o *Object) Name() string {
return o.name
}
// Attrs returns an object's attributes.
func (o *Object) Attrs(ctx context.Context) (*Attrs, error) {
if err := o.ensure(ctx); err != nil {