diff options
Diffstat (limited to 'buildstream/storage/_casbaseddirectory.py')
-rw-r--r-- | buildstream/storage/_casbaseddirectory.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/buildstream/storage/_casbaseddirectory.py b/buildstream/storage/_casbaseddirectory.py index a99b4868f..53fdb037f 100644 --- a/buildstream/storage/_casbaseddirectory.py +++ b/buildstream/storage/_casbaseddirectory.py @@ -399,11 +399,11 @@ class CasBasedDirectory(Directory): if c == ".": pass elif c == "..": + if directory.parent is not None: + directory = directory.parent # If directory.parent *is* None, this is an attempt to access # '..' from the root, which is valid under POSIX; it just # returns the root. - if directory.parent is not None: - directory = directory.parent else: if c in directory.index: f = directory._resolve(c, absolute_symlinks_resolve, first_seen_object=first_seen_object) |