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:
parent
fce667a905
commit
4157af999f
3 changed files with 8 additions and 8 deletions
|
@ -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
2
vendor/manifest
vendored
|
@ -34,7 +34,7 @@
|
|||
{
|
||||
"importpath": "github.com/kurin/blazer",
|
||||
"repository": "https://github.com/kurin/blazer",
|
||||
"revision": "b1c2abe264719d4d2062dbeb10d17d5de28d26ca",
|
||||
"revision": "fff096e261374c464c633ef70b264f5e9651b091",
|
||||
"branch": "master"
|
||||
},
|
||||
{
|
||||
|
|
5
vendor/src/github.com/kurin/blazer/b2/b2.go
vendored
5
vendor/src/github.com/kurin/blazer/b2/b2.go
vendored
|
@ -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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue