MCPcopy Index your code
hub / github.com/kopia/kopia / run

Method run

cli/command_ls.go:41–56  ·  view source on GitHub ↗
(ctx context.Context, rep repo.Repository)

Source from the content-addressed store, hash-verified

39}
40
41func (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
58func (c *commandList) listDirectory(ctx context.Context, d fs.Directory, prefix, indent string) error {
59 iter, err := d.Iterate(ctx)

Callers 1

runAppWithContextMethod · 0.45

Calls 2

listDirectoryMethod · 0.95

Tested by

no test coverage detected