2
2
mirror of https://github.com/octoleo/restic.git synced 2024-11-02 11:46:36 +00:00

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