1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2025-01-01 04:37:34 +00:00

fuse: fix directories being shadowed when contained paths where also specified

This commit is contained in:
Marian Beermann 2016-07-09 02:28:54 +02:00
parent 66cc520880
commit 39f48419a0
No known key found for this signature in database
GPG key ID: 9B8450B91D1362C1

View file

@ -76,6 +76,16 @@ def process_archive(self, archive, prefix=[]):
data = self.key.decrypt(key, chunk)
unpacker.feed(data)
for item in unpacker:
try:
# This can happen if an archive was created with a command line like
# $ borg create ... dir1/file dir1
# In this case the code below will have created a default_dir inode for dir1 already.
inode = self._find_inode(item[b'path'], prefix)
except KeyError:
pass
else:
self.items[inode] = item
continue
segments = prefix + os.fsencode(os.path.normpath(item[b'path'])).split(b'/')
del item[b'path']
num_segments = len(segments)