mirror of
https://github.com/jkl1337/duplicacy.git
synced 2026-01-02 11:44:45 -06:00
Skip identical entries when listing chunks
The prune command can remove redundant chunks (chunks with the same chunk id but at different subdirectory level). However, if the same chunk appears mutliple times in the listing returned by the storage, it will be treated as a redundant chunk and thus removed.
This commit is contained in:
@@ -2427,7 +2427,13 @@ func (manager *SnapshotManager) pruneSnapshotsExhaustive(referencedFossils map[s
|
||||
}
|
||||
|
||||
allFiles, _ := manager.ListAllFiles(manager.storage, chunkDir)
|
||||
uniqueFiles := make(map[string]bool)
|
||||
for _, file := range allFiles {
|
||||
if _, found := uniqueFiles[file]; found {
|
||||
continue
|
||||
}
|
||||
uniqueFiles[file] = true
|
||||
|
||||
if len(file) == 0 || file[len(file)-1] == '/' {
|
||||
continue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user