(ctx context.Context, rep repo.Repository, sourceInfo snapshot.SourceInfo, tags map[string]string)
| 63 | } |
| 64 | |
| 65 | func 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 | |
| 89 | func findRelativePathParts(m *snapshot.Manifest, path string) ([]string, error) { |
| 90 | if path == "" { |
no test coverage detected