MCPcopy
hub / github.com/kopia/kopia / findSnapshotsForSource

Function findSnapshotsForSource

cli/command_snapshot_list.go:65–87  ·  view source on GitHub ↗
(ctx context.Context, rep repo.Repository, sourceInfo snapshot.SourceInfo, tags map[string]string)

Source from the content-addressed store, hash-verified

63}
64
65func findSnapshotsForSource(ctx context.Context, rep repo.Repository, sourceInfo snapshot.SourceInfo, tags map[string]string) (manifestIDs []manifest.ID, err error) {
66 var result []manifest.ID
67
68 for sourceInfo.Path != "" {
69 list, err := snapshot.ListSnapshotManifests(ctx, rep, &sourceInfo, tags)
70 if err != nil {
71 return nil, errors.Wrapf(err, "error listing manifests for %v", sourceInfo)
72 }
73
74 if len(list) > 0 {
75 result = append(result, list...)
76 }
77
78 parentPath := filepath.Dir(sourceInfo.Path)
79 if parentPath == sourceInfo.Path {
80 break
81 }
82
83 sourceInfo.Path = parentPath
84 }
85
86 return result, nil
87}
88
89func findRelativePathParts(m *snapshot.Manifest, path string) ([]string, error) {
90 if path == "" {

Callers 2

findManifestIDsFunction · 0.85
tryToConvertPathToIDMethod · 0.85

Calls 1

ListSnapshotManifestsFunction · 0.92

Tested by

no test coverage detected