2
2
mirror of https://github.com/octoleo/restic.git synced 2024-11-19 03:25:19 +00:00

Merge pull request #650 from restic/forget-remove-index-load

forget: do not load index
This commit is contained in:
Alexander Neumann 2016-10-24 14:33:11 +02:00
commit d4f76fbe26
2 changed files with 3 additions and 8 deletions

View File

@ -112,11 +112,6 @@ func runForget(opts ForgetOptions, gopts GlobalOptions, args []string) error {
return err return err
} }
err = repo.LoadIndex()
if err != nil {
return err
}
// parse arguments as hex strings // parse arguments as hex strings
var ids []string var ids []string
for _, s := range args { for _, s := range args {

View File

@ -39,13 +39,13 @@ func printNode(prefix string, n *restic.Node) string {
switch n.Type { switch n.Type {
case "file": case "file":
return fmt.Sprintf("%s %5d %5d %6d %s %s", return fmt.Sprintf("%s %5d %5d %6d %s %s",
n.Mode, n.UID, n.GID, n.Size, n.ModTime, filepath.Join(prefix, n.Name)) n.Mode, n.UID, n.GID, n.Size, n.ModTime.Format(TimeFormat), filepath.Join(prefix, n.Name))
case "dir": case "dir":
return fmt.Sprintf("%s %5d %5d %6d %s %s", return fmt.Sprintf("%s %5d %5d %6d %s %s",
n.Mode|os.ModeDir, n.UID, n.GID, n.Size, n.ModTime, filepath.Join(prefix, n.Name)) n.Mode|os.ModeDir, n.UID, n.GID, n.Size, n.ModTime.Format(TimeFormat), filepath.Join(prefix, n.Name))
case "symlink": case "symlink":
return fmt.Sprintf("%s %5d %5d %6d %s %s -> %s", return fmt.Sprintf("%s %5d %5d %6d %s %s -> %s",
n.Mode|os.ModeSymlink, n.UID, n.GID, n.Size, n.ModTime, filepath.Join(prefix, n.Name), n.LinkTarget) n.Mode|os.ModeSymlink, n.UID, n.GID, n.Size, n.ModTime.Format(TimeFormat), filepath.Join(prefix, n.Name), n.LinkTarget)
default: default:
return fmt.Sprintf("<Node(%s) %s>", n.Type, n.Name) return fmt.Sprintf("<Node(%s) %s>", n.Type, n.Name)
} }