Merge pull request #4615 from ThomasWaldmann/fix-4607-extract-hl-crash-1.1

extract: fix KeyError for "partial" extraction
This commit is contained in:
TW 2019-06-10 19:41:33 +02:00 committed by GitHub
commit bf496d5a66
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -201,6 +201,7 @@ class DownloadPipeline:
Warning: if *preload* is True then all data chunks of every yielded item have to be retrieved,
otherwise preloaded chunks will accumulate in RemoteRepository and create a memory leak.
"""
masters_preloaded = set()
unpacker = msgpack.Unpacker(use_list=False)
for data in self.fetch_many(ids):
unpacker.feed(data)
@ -222,7 +223,6 @@ class DownloadPipeline:
# selected (== not extracted), we will still need to preload its chunks if a
# corresponding hardlink slave is selected (== is extracted).
# due to a side effect of the filter() call, we now have hardlink_masters dict populated.
masters_preloaded = set()
for item in items:
if 'chunks' in item: # regular file, maybe a hardlink master
preload(item.chunks)