MCPcopy Create free account
hub / github.com/bootc-dev/bootc / export_commit

Function export_commit

crates/ostree-ext/src/tar/export.rs:824–836  ·  view source on GitHub ↗
(
    repo: &ostree::Repo,
    rev: &str,
    out: impl std::io::Write,
    options: Option<ExportOptions>,
)

Source from the content-addressed store, hash-verified

822/// Export an ostree commit to an (uncompressed) tar archive stream.
823#[context("Exporting commit")]
824pub fn export_commit(
825 repo: &ostree::Repo,
826 rev: &str,
827 out: impl std::io::Write,
828 options: Option<ExportOptions>,
829) -> Result<()> {
830 let commit = repo.require_rev(rev)?;
831 let mut tar = tar::Builder::new(out);
832 let options = options.unwrap_or_default();
833 impl_export(repo, commit.as_str(), &mut tar, options)?;
834 tar.finish()?;
835 Ok(())
836}
837
838/// Chunked (or version 1) tar streams don't have a leading `./`.
839fn path_for_tar_v1(p: &Utf8Path) -> &Utf8Path {

Callers 4

export_tarMethod · 0.85
tar_exportFunction · 0.85
export_to_ociFunction · 0.85

Calls 2

impl_exportFunction · 0.85
finishMethod · 0.80

Tested by 1