mirror of
https://github.com/restic/restic.git
synced 2026-11-19 23:01:08 +00:00
repository: remove SaveIndex from interface
The method is now only indirectly accessible via Prune or RepairIndex.
This commit is contained in:
1 parent
fb59e00614
commit
550d1eeac3
7 files changed
+22
-52
No files matched your search
@@ -312,10 +312,17 @@ func (mi *MasterIndex) Load(ctx context.Context, r restic.ListerLoaderUnpacked,
|
||||
return mi.MergeFinalIndexes()
|
||||
}
|
||||
|
||||
type MasterIndexSaveOpts struct {
|
||||
SaveProgress *progress.Counter
|
||||
DeleteProgress func() *progress.Counter
|
||||
DeleteReport func(id restic.ID, err error)
|
||||
SkipDeletion bool
|
||||
}
|
||||
|
||||
// Save saves all known indexes to index files, leaving out any
|
||||
// packs whose ID is contained in packBlacklist from finalized indexes.
|
||||
// It also removes the old index files and those listed in extraObsolete.
|
||||
func (mi *MasterIndex) Save(ctx context.Context, repo restic.SaverRemoverUnpacked, excludePacks restic.IDSet, extraObsolete restic.IDs, opts restic.MasterIndexSaveOpts) error {
|
||||
func (mi *MasterIndex) Save(ctx context.Context, repo restic.SaverRemoverUnpacked, excludePacks restic.IDSet, extraObsolete restic.IDs, opts MasterIndexSaveOpts) error {
|
||||
p := opts.SaveProgress
|
||||
p.SetMax(uint64(len(mi.Packs(excludePacks))))
|
||||
|
||||
|
||||
@@ -364,7 +364,7 @@ func testIndexSave(t *testing.T, version uint) {
|
||||
blobs[pb] = struct{}{}
|
||||
}))
|
||||
|
||||
rtest.OK(t, idx.Save(context.TODO(), repo, nil, nil, restic.MasterIndexSaveOpts{}))
|
||||
rtest.OK(t, idx.Save(context.TODO(), repo, nil, nil, index.MasterIndexSaveOpts{}))
|
||||
idx = index.NewMasterIndex()
|
||||
rtest.OK(t, idx.Load(context.TODO(), repo, nil, nil))
|
||||
|
||||
|
||||
Reference in new issue
Block a user