about summary refs log tree commit diff
path: root/tvix/castore/src/import/mod.rs
diff options
context:
space:
mode:
authorConnor Brewster <cbrewster@hey.com>2024-04-20T14·19-0500
committerclbot <clbot@tvl.fyi>2024-04-23T15·31+0000
commitfa69becf4d723c1549d8252eeabeb256423dbc19 (patch)
treed150d855b9ba5c276cf87d400fc6810315ebb22b /tvix/castore/src/import/mod.rs
parent49b63fceeecca9192d2c418313b550e49ea6b365 (diff)
refactor(tvix/castore): switch to `ingest_entries` for tarball ingestion r/8000
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 <flokli@flokli.de>
Autosubmit: Connor Brewster <cbrewster@hey.com>
Tested-by: BuildkiteCI
Diffstat (limited to '')
-rw-r--r--tvix/castore/src/import/mod.rs5
1 files changed, 5 insertions, 0 deletions
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 { .. })
+    }
 }