From fa69becf4d723c1549d8252eeabeb256423dbc19 Mon Sep 17 00:00:00 2001 From: Connor Brewster Date: Sat, 20 Apr 2024 09:19:05 -0500 Subject: refactor(tvix/castore): switch to `ingest_entries` for tarball ingestion With `ingest_entries` being more generalized, we can now use it for ingesting the directory entries generated from tarballs. Change-Id: Ie1f7a915c456045762e05fcc9af45771f121eb43 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11489 Reviewed-by: flokli Autosubmit: Connor Brewster Tested-by: BuildkiteCI --- tvix/castore/src/import/mod.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tvix/castore/src/import/mod.rs') diff --git a/tvix/castore/src/import/mod.rs b/tvix/castore/src/import/mod.rs index 09d5b8d06e..e9fdc750f8 100644 --- a/tvix/castore/src/import/mod.rs +++ b/tvix/castore/src/import/mod.rs @@ -199,6 +199,7 @@ where Ok(digest) } +#[derive(Debug, Clone, Eq, PartialEq)] pub enum IngestionEntry { Regular { path: PathBuf, @@ -228,4 +229,8 @@ impl IngestionEntry { IngestionEntry::Unknown { path, .. } => path, } } + + fn is_dir(&self) -> bool { + matches!(self, IngestionEntry::Dir { .. }) + } } -- cgit 1.4.1