(act func(ctx context.Context, rep repo.RepositoryWriter) error)
| 450 | } |
| 451 | |
| 452 | func (c *App) repositoryWriterAction(act func(ctx context.Context, rep repo.RepositoryWriter) error) func(ctx *kingpin.ParseContext) error { |
| 453 | return c.repositoryAction(func(ctx context.Context, rep repo.Repository) error { |
| 454 | return repo.WriteSession(ctx, rep, repo.WriteSessionOptions{ |
| 455 | Purpose: "cli:" + c.currentActionName(), |
| 456 | OnUpload: c.progress.UploadedBytes, |
| 457 | }, func(ctx context.Context, w repo.RepositoryWriter) error { |
| 458 | return act(ctx, w) |
| 459 | }) |
| 460 | }, repositoryAccessMode{ |
| 461 | allowMaintenance: true, |
| 462 | }) |
| 463 | } |
| 464 | |
| 465 | func (c *App) runAppWithContext(command *kingpin.CmdClause, cb func(ctx context.Context) error) error { |
| 466 | ctx := c.rootctx |
nothing calls this directly
no test coverage detected