mirror of
https://github.com/restic/restic.git
synced 2024-12-23 08:16:36 +00:00
Merge pull request #4079 from MichaelEischer/rewrite-set-original
rewrite: Always set the Original field in a rewritten snapshot
This commit is contained in:
commit
7bdb985dde
2 changed files with 3 additions and 4 deletions
|
@ -5,3 +5,4 @@ unwanted files.
|
|||
|
||||
https://github.com/restic/restic/issues/14
|
||||
https://github.com/restic/restic/pull/2731
|
||||
https://github.com/restic/restic/pull/4079
|
||||
|
|
|
@ -123,10 +123,8 @@ func rewriteSnapshot(ctx context.Context, repo *repository.Repository, sn *resti
|
|||
return true, nil
|
||||
}
|
||||
|
||||
// Retain the original snapshot id over all tag changes.
|
||||
if sn.Original == nil {
|
||||
sn.Original = sn.ID()
|
||||
}
|
||||
// Always set the original snapshot id as this essentially a new snapshot.
|
||||
sn.Original = sn.ID()
|
||||
*sn.Tree = filteredTree
|
||||
|
||||
if !opts.Forget {
|
||||
|
|
Loading…
Reference in a new issue