mirror of
https://github.com/restic/restic.git
synced 2025-12-12 03:11:56 +00:00
prune/repair index: reset in-memory index after command
The current in-memory index becomes stale after prune or repair index have run. Thus, just drop the in-memory index altogether once these commands have finished.
This commit is contained in:
@@ -98,7 +98,14 @@ func RepairIndex(ctx context.Context, repo *Repository, opts RepairIndexOptions,
|
||||
}
|
||||
}
|
||||
|
||||
return rebuildIndexFiles(ctx, repo, removePacks, obsoleteIndexes, false, printer)
|
||||
err = rebuildIndexFiles(ctx, repo, removePacks, obsoleteIndexes, false, printer)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// drop outdated in-memory index
|
||||
repo.ClearIndex()
|
||||
return nil
|
||||
}
|
||||
|
||||
func rebuildIndexFiles(ctx context.Context, repo restic.Repository, removePacks restic.IDSet, extraObsolete restic.IDs, skipDeletion bool, printer progress.Printer) error {
|
||||
|
||||
Reference in New Issue
Block a user