diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/buildstream/storage/_casbaseddirectory.py | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/buildstream/storage/_casbaseddirectory.py b/src/buildstream/storage/_casbaseddirectory.py index 34cd1df8f..75399953e 100644 --- a/src/buildstream/storage/_casbaseddirectory.py +++ b/src/buildstream/storage/_casbaseddirectory.py @@ -147,10 +147,25 @@ class CasBasedDirectory(Directory): if digest: self._populate_index(digest) - def _reset(self, *, digest=None): + # _clear(): + # + # Remove all entries from this directory. + # + def _clear(self): self.__invalidate_digest() self.index = {} + # _reset(): + # + # Replace the contents of this directory with the entries from the specified + # directory digest. + # + # Args: + # digest (Digest): The digest of the replacement directory + # + def _reset(self, *, digest=None): + self._clear() + if digest: self.__digest = digest self._populate_index(digest) |