From ef060ad74498289fe7ed2216fd5282db375827ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Billeter?= Date: Wed, 22 Jan 2020 13:43:59 +0100 Subject: _casbaseddirectory.py: Add _create_empty_file() method --- src/buildstream/storage/_casbaseddirectory.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') diff --git a/src/buildstream/storage/_casbaseddirectory.py b/src/buildstream/storage/_casbaseddirectory.py index 553030b5a..3ab11a6ed 100644 --- a/src/buildstream/storage/_casbaseddirectory.py +++ b/src/buildstream/storage/_casbaseddirectory.py @@ -213,6 +213,14 @@ class CasBasedDirectory(Directory): self.__invalidate_digest() + def _create_empty_file(self, name): + digest = self.cas_cache.add_object(buffer="") + + entry = IndexEntry(name, _FileType.REGULAR_FILE, digest=digest) + self.index[name] = entry + + self.__invalidate_digest() + def _add_entry(self, entry: IndexEntry): self.index[entry.name] = entry.clone() self.__invalidate_digest() -- cgit v1.2.1