mirror of
https://github.com/octoleo/restic.git
synced 2025-01-10 18:04:38 +00:00
prune: Fix crash on empty snapshot
This commit is contained in:
parent
88a8701fb5
commit
173695104c
@ -596,10 +596,11 @@ func getUsedBlobs(gopts GlobalOptions, repo restic.Repository, ignoreSnapshots r
|
|||||||
Verbosef("loading all snapshots...\n")
|
Verbosef("loading all snapshots...\n")
|
||||||
err = restic.ForAllSnapshots(gopts.ctx, repo.Backend(), repo, ignoreSnapshots,
|
err = restic.ForAllSnapshots(gopts.ctx, repo.Backend(), repo, ignoreSnapshots,
|
||||||
func(id restic.ID, sn *restic.Snapshot, err error) error {
|
func(id restic.ID, sn *restic.Snapshot, err error) error {
|
||||||
debug.Log("add snapshot %v (tree %v, error %v)", id, *sn.Tree, err)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
debug.Log("failed to load snapshot %v (error %v)", id, err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
debug.Log("add snapshot %v (tree %v)", id, *sn.Tree)
|
||||||
snapshotTrees = append(snapshotTrees, *sn.Tree)
|
snapshotTrees = append(snapshotTrees, *sn.Tree)
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user