From bc911f4609cbb15af3fffb6313aba392b0e2ad9b Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Sun, 21 Feb 2016 00:22:46 +0100 Subject: [PATCH] cmd_dump: Only load pack header --- src/cmds/restic/cmd_dump.go | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/cmds/restic/cmd_dump.go b/src/cmds/restic/cmd_dump.go index c07d0ea57..56b010693 100644 --- a/src/cmds/restic/cmd_dump.go +++ b/src/cmds/restic/cmd_dump.go @@ -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 }