cmd_dump: Only load pack header

This commit is contained in:
Alexander Neumann 2016-02-21 00:22:46 +01:00
parent 090920039f
commit bc911f4609

View file

@ -3,7 +3,6 @@
package main package main
import ( import (
"bytes"
"encoding/json" "encoding/json"
"fmt" "fmt"
"io" "io"
@ -14,8 +13,9 @@ import (
"restic/pack" "restic/pack"
"restic/repository" "restic/repository"
"github.com/juju/errors"
"restic/worker" "restic/worker"
"github.com/juju/errors"
) )
type CmdDump struct { type CmdDump struct {
@ -126,12 +126,9 @@ func printPacks(repo *repository.Repository, wr io.Writer) error {
name := job.Data.(string) name := job.Data.(string)
h := backend.Handle{Type: backend.Data, Name: name} h := backend.Handle{Type: backend.Data, Name: name}
buf, err := backend.LoadAll(repo.Backend(), h, nil) rd := backend.NewReadSeeker(repo.Backend(), h)
if err != nil {
return nil, err
}
unpacker, err := pack.NewUnpacker(repo.Key(), bytes.NewReader(buf)) unpacker, err := pack.NewUnpacker(repo.Key(), rd)
if err != nil { if err != nil {
return nil, err return nil, err
} }