(ctx context.Context, rep repo.Repository)
| 39 | } |
| 40 | |
| 41 | func (c *commandList) run(ctx context.Context, rep repo.Repository) error { |
| 42 | dir, err := snapshotfs.FilesystemDirectoryFromIDWithPath(ctx, rep, c.path, false) |
| 43 | if err != nil { |
| 44 | return errors.Wrap(err, "unable to get filesystem directory entry") |
| 45 | } |
| 46 | |
| 47 | var prefix string |
| 48 | if !c.long { |
| 49 | prefix = c.path |
| 50 | if !strings.HasSuffix(prefix, "/") { |
| 51 | prefix += "/" |
| 52 | } |
| 53 | } |
| 54 | |
| 55 | return c.listDirectory(ctx, dir, prefix, "") |
| 56 | } |
| 57 | |
| 58 | func (c *commandList) listDirectory(ctx context.Context, d fs.Directory, prefix, indent string) error { |
| 59 | iter, err := d.Iterate(ctx) |
no test coverage detected