MCPcopy
hub / github.com/kopia/kopia / openSourceRepo

Method openSourceRepo

cli/command_snapshot_migrate.go:143–159  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

141}
142
143func (c *commandSnapshotMigrate) openSourceRepo(ctx context.Context) (repo.Repository, error) {
144 pass, err := c.svc.passwordPersistenceStrategy().GetPassword(ctx, c.migrateSourceConfig)
145 if err != nil {
146 pass, err = c.svc.getPasswordFromFlags(ctx, false, false)
147 }
148
149 if err != nil {
150 return nil, errors.Wrap(err, "source repository password")
151 }
152
153 sourceRepo, err := repo.Open(ctx, c.migrateSourceConfig, pass, c.svc.optionsFromFlags(ctx))
154 if err != nil {
155 return nil, errors.Wrap(err, "can't open source repository")
156 }
157
158 return sourceRepo, nil
159}
160
161func (c *commandSnapshotMigrate) migratePoliciesForSources(ctx context.Context, sourceRepo repo.Repository, destRepo repo.RepositoryWriter, sources []snapshot.SourceInfo) error {
162 for _, si := range sources {

Callers 1

runMethod · 0.95

Calls 5

OpenFunction · 0.92
GetPasswordMethod · 0.65
getPasswordFromFlagsMethod · 0.65
optionsFromFlagsMethod · 0.65

Tested by

no test coverage detected