Skip to main content

bundle

Function bundle 

Source
pub async fn bundle(
    repo: &Repository,
    folder: &Path,
    sha: Sha,
    spec: &str,
) -> Result<PathBuf, GitError>
Expand description

Write a git bundle for spec to <folder>/<sha>.bundle and return the absolute path.

spec is a rev-spec — a fully-qualified ref (refs/heads/main), a short branch (main), HEAD, or a SHA. All objects reachable from the resolved commit are included.

The returned future is not Send: gix::Repository is !Sync, so the captured &Repository parameter cannot cross thread boundaries. Callers must .await it directly rather than passing it to tokio::spawn.

§Errors

Returns GitError::Bundle if the spec cannot be resolved, the commit graph cannot be walked, or the bundle file cannot be written. Returns GitError::Panic if the blocking task panics.