mirror of https://github.com/borgbackup/borg.git
fuse: slightly refactor shadowing detection
if it is not a directory, the old code was a NOP, so we can just check that first.
This commit is contained in:
parent
83c99943c3
commit
8b5372b54c
|
@ -140,14 +140,12 @@ class FuseOperations(llfuse.Operations):
|
||||||
for item in unpacker:
|
for item in unpacker:
|
||||||
item = Item(internal_dict=item)
|
item = Item(internal_dict=item)
|
||||||
is_dir = stat.S_ISDIR(item.mode)
|
is_dir = stat.S_ISDIR(item.mode)
|
||||||
|
if is_dir:
|
||||||
try:
|
try:
|
||||||
# This can happen if an archive was created with a command line like
|
# This can happen if an archive was created with a command line like
|
||||||
# $ borg create ... dir1/file dir1
|
# $ borg create ... dir1/file dir1
|
||||||
# In this case the code below will have created a default_dir inode for dir1 already.
|
# In this case the code below will have created a default_dir inode for dir1 already.
|
||||||
path = safe_encode(item.path)
|
path = safe_encode(item.path)
|
||||||
if not is_dir:
|
|
||||||
# not a directory -> no lookup needed
|
|
||||||
raise KeyError
|
|
||||||
inode = self._find_inode(path, prefix)
|
inode = self._find_inode(path, prefix)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
pass
|
||||||
|
|
Loading…
Reference in New Issue