(ctx context.Context, rep repo.Repository, rstp restoreSourceTarget, output restore.Output)
| 370 | } |
| 371 | |
| 372 | func (c *commandRestore) setupPlaceholderExpansion(ctx context.Context, rep repo.Repository, rstp restoreSourceTarget, output restore.Output) (fs.Entry, error) { |
| 373 | rootEntry, err := snapshotfs.GetEntryFromPlaceholder(ctx, rep, localfs.PlaceholderFilePath(rstp.source)) |
| 374 | if err != nil { |
| 375 | return nil, errors.Wrapf(err, "unable to get filesystem entry for placeholder %q", rstp.source) |
| 376 | } |
| 377 | |
| 378 | fso, ok := output.(*restore.FilesystemOutput) |
| 379 | if !ok { |
| 380 | return nil, errors.New("placeholder expansion is only relevant to filesystem output") |
| 381 | } |
| 382 | |
| 383 | fso.TargetPath = rstp.target |
| 384 | |
| 385 | // restoreShallowAtDepth defaults to 0 when expanding a placeholder. |
| 386 | if c.restoreShallowAtDepth == unlimitedDepth { |
| 387 | c.restoreShallowAtDepth = 0 |
| 388 | } |
| 389 | |
| 390 | return rootEntry, nil |
| 391 | } |
| 392 | |
| 393 | func (c *commandRestore) getRestoreProgress() RestoreProgress { |
| 394 | if rp := c.svc.getRestoreProgress(); rp != nil { |
no test coverage detected