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

Method setupPlaceholderExpansion

cli/command_restore.go:372–391  ·  view source on GitHub ↗
(ctx context.Context, rep repo.Repository, rstp restoreSourceTarget, output restore.Output)

Source from the content-addressed store, hash-verified

370}
371
372func (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
393func (c *commandRestore) getRestoreProgress() RestoreProgress {
394 if rp := c.svc.getRestoreProgress(); rp != nil {

Callers 1

runMethod · 0.95

Calls 2

GetEntryFromPlaceholderFunction · 0.92
PlaceholderFilePathTypeAlias · 0.92

Tested by

no test coverage detected