From 83c8a9b058e8e5a70c89a7bc9f4c9fcd82f6bb19 Mon Sep 17 00:00:00 2001
From: Alexander Weiss <alex@weissfam.de>
Date: Sat, 5 Dec 2020 20:57:06 +0100
Subject: [PATCH] Bugfix: packSizeFromList should save size from List()

---
 cmd/restic/cmd_rebuild_index.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmd/restic/cmd_rebuild_index.go b/cmd/restic/cmd_rebuild_index.go
index e1fdcd7e4..27f36d2b9 100644
--- a/cmd/restic/cmd_rebuild_index.go
+++ b/cmd/restic/cmd_rebuild_index.go
@@ -96,7 +96,7 @@ func rebuildIndex(opts RebuildIndexOptions, gopts GlobalOptions, repo *repositor
 			size, ok := packSizeFromIndex[id]
 			if !ok || size != packSize {
 				// Pack was not referenced in index or size does not match
-				packSizeFromList[id] = size
+				packSizeFromList[id] = packSize
 				removePacks.Insert(id)
 			}
 			totalPacks++