mirror of
https://github.com/octoleo/restic.git
synced 2025-02-02 03:48:25 +00:00
Fix ls command
Added missing loadindex call. Also fixed the recursive call to use the subtree to stop infinte recursion.
This commit is contained in:
parent
92de007900
commit
e8615eb593
@ -48,7 +48,7 @@ func printTree(prefix string, s *server.Server, id backend.ID) error {
|
||||
fmt.Println(printNode(prefix, entry))
|
||||
|
||||
if entry.Type == "dir" && entry.Subtree != nil {
|
||||
err = printTree(filepath.Join(prefix, entry.Name), s, id)
|
||||
err = printTree(filepath.Join(prefix, entry.Name), s, entry.Subtree)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -72,6 +72,11 @@ func (cmd CmdLs) Execute(args []string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
err = s.LoadIndex()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
name, err := backend.FindSnapshot(s, args[0])
|
||||
if err != nil {
|
||||
return err
|
||||
|
Loading…
x
Reference in New Issue
Block a user