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 <flokli@flokli.de>
Autosubmit: Connor Brewster <cbrewster@hey.com>
Tested-by: BuildkiteCI
This commit is contained in:
Connor Brewster 2024-04-20 09:19:05 -05:00 committed by clbot
parent 49b63fceee
commit fa69becf4d
3 changed files with 242 additions and 131 deletions

View file

@ -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 { .. })
}
}