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

Method runPhase

cli/command_repository_upgrade.go:249–267  ·  view source on GitHub ↗
(act func(context.Context, repo.DirectRepositoryWriter) error)

Source from the content-addressed store, hash-verified

247}
248
249func (c *commandRepositoryUpgrade) runPhase(act func(context.Context, repo.DirectRepositoryWriter) error) func(context.Context, repo.DirectRepositoryWriter) error {
250 return func(ctx context.Context, rep repo.DirectRepositoryWriter) error {
251 if c.skip {
252 return nil
253 }
254
255 err := act(ctx, rep)
256 if err != nil {
257 // Explicitly skip all stages on error because tests do not
258 // skip/exit on error. Tests override os.Exit() that prevents
259 // running rest of the phases until we set the skip flag here.
260 // This flag is designed for testability and also to support
261 // rollback.
262 c.skip = true
263 }
264
265 return err
266 }
267}
268
269func (c *commandRepositoryUpgrade) ignoreErrorOnAlwaysCommit(act func(context.Context, repo.DirectRepositoryWriter) error) func(context.Context, repo.DirectRepositoryWriter) error {
270 return func(ctx context.Context, rep repo.DirectRepositoryWriter) error {

Callers 1

setupMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected