Add checks for Server.Load(), use Blob for load

This commit is contained in:
Alexander Neumann
2015-03-28 15:07:08 +01:00
parent 5e69788eac
commit f157f775da
16 changed files with 120 additions and 131 deletions

View File

@@ -76,7 +76,7 @@ func (cmd CmdCat) Execute(args []string) error {
case "tree":
// try storage id
tree := &restic.Tree{}
err := s.LoadJSONID(backend.Tree, id.String(), tree)
err := s.LoadJSONID(backend.Tree, id, tree)
if err != nil {
return err
}
@@ -91,7 +91,7 @@ func (cmd CmdCat) Execute(args []string) error {
return nil
case "snapshot":
sn := &restic.Snapshot{}
err = s.LoadJSONID(backend.Snapshot, id.String(), sn)
err = s.LoadJSONID(backend.Snapshot, id, sn)
if err != nil {
return err
}
@@ -105,7 +105,7 @@ func (cmd CmdCat) Execute(args []string) error {
return nil
case "key":
rd, err := s.Get(backend.Key, id.String())
rd, err := s.Backend().Get(backend.Key, id.String())
if err != nil {
return err
}

View File

@@ -66,7 +66,7 @@ func parseTime(str string) (time.Time, error) {
func (c CmdFind) findInTree(s restic.Server, blob restic.Blob, path string) ([]findResult, error) {
debug.Log("restic.find", "checking tree %v\n", blob)
tree, err := restic.LoadTree(s, blob.Storage)
tree, err := restic.LoadTree(s, blob)
if err != nil {
return nil, err
}

View File

@@ -77,7 +77,7 @@ func fsckFile(opts CmdFsck, s restic.Server, m *restic.Map, IDs []backend.ID) (u
func fsckTree(opts CmdFsck, s restic.Server, blob restic.Blob) error {
debug.Log("restic.fsckTree", "checking tree %v", blob)
tree, err := restic.LoadTree(s, blob.Storage)
tree, err := restic.LoadTree(s, blob)
if err != nil {
return err
}

View File

@@ -38,7 +38,7 @@ func print_node(prefix string, n *restic.Node) string {
}
func print_tree(prefix string, s restic.Server, blob restic.Blob) error {
tree, err := restic.LoadTree(s, blob.Storage)
tree, err := restic.LoadTree(s, blob)
if err != nil {
return err
}