MCPcopy
hub / github.com/kopia/kopia / shouldSnapshotSource

Function shouldSnapshotSource

cli/command_snapshot_create.go:447–456  ·  view source on GitHub ↗
(ctx context.Context, src snapshot.SourceInfo, rep repo.Repository)

Source from the content-addressed store, hash-verified

445}
446
447func shouldSnapshotSource(ctx context.Context, src snapshot.SourceInfo, rep repo.Repository) (bool, error) {
448 policyTree, err := policy.TreeForSource(ctx, rep, src)
449 if err != nil {
450 return false, errors.Wrapf(err, "unable to get policy tree for source %v", src)
451 }
452
453 return src.Host == rep.ClientOptions().Hostname &&
454 src.UserName == rep.ClientOptions().Username &&
455 !policy.IsManualSnapshot(policyTree), nil
456}
457
458// the setManual return value is true when a snapshot is manually created, such
459// as when overriding the source info or snapshotting from stdin.

Callers 1

getLocalBackupPathsFunction · 0.85

Calls 3

TreeForSourceFunction · 0.92
IsManualSnapshotFunction · 0.92
ClientOptionsMethod · 0.65

Tested by

no test coverage detected