mirror of
https://github.com/restic/restic.git
synced 2025-10-11 03:12:38 +00:00
repository: Properly set id for finalized index
As MergeFinalIndex and index uploads can occur concurrently, it is necessary for MergeFinalIndex to check whether the IDs for an index were already set before merging it. Otherwise, we'd loose the ID of an index which is set _after_ uploading it.
This commit is contained in:
@@ -582,12 +582,6 @@ func (r *Repository) LoadIndex(ctx context.Context) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
_, err = idx.IDs()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
r.idx.Insert(idx)
|
||||
return nil
|
||||
})
|
||||
|
Reference in New Issue
Block a user