Fix setting of ID in DecodeIndex

This commit is contained in:
Alexander Weiss
2020-10-17 09:06:10 +02:00
parent 4ba237bb93
commit b44ecde8b0
4 changed files with 19 additions and 10 deletions

View File

@@ -520,7 +520,7 @@ func isErrOldIndex(err error) bool {
}
// DecodeIndex unserializes an index from buf.
func DecodeIndex(buf []byte) (idx *Index, oldFormat bool, err error) {
func DecodeIndex(buf []byte, id restic.ID) (idx *Index, oldFormat bool, err error) {
debug.Log("Start decoding index")
idxJSON := &jsonIndex{}
@@ -563,6 +563,7 @@ func DecodeIndex(buf []byte) (idx *Index, oldFormat bool, err error) {
}
}
idx.supersedes = idxJSON.Supersedes
idx.ids = append(idx.ids, id)
idx.final = true
debug.Log("done")