mirror of
https://github.com/restic/restic.git
synced 2025-08-23 11:27:54 +00:00
add program version to snapshot
This commit is contained in:
@@ -680,6 +680,7 @@ type SnapshotOptions struct {
|
||||
Excludes []string
|
||||
Time time.Time
|
||||
ParentSnapshot *restic.Snapshot
|
||||
ProgramVersion string
|
||||
}
|
||||
|
||||
// loadParentTree loads a tree referenced by snapshot id. If id is null, nil is returned.
|
||||
@@ -796,6 +797,7 @@ func (arch *Archiver) Snapshot(ctx context.Context, targets []string, opts Snaps
|
||||
return nil, restic.ID{}, err
|
||||
}
|
||||
|
||||
sn.ProgramVersion = opts.ProgramVersion
|
||||
sn.Excludes = opts.Excludes
|
||||
if opts.ParentSnapshot != nil {
|
||||
sn.Parent = opts.ParentSnapshot.ID()
|
||||
|
@@ -25,6 +25,8 @@ type Snapshot struct {
|
||||
Tags []string `json:"tags,omitempty"`
|
||||
Original *ID `json:"original,omitempty"`
|
||||
|
||||
ProgramVersion string `json:"program_version,omitempty"`
|
||||
|
||||
id *ID // plaintext ID, used during restore
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user