Skip to main content

archive

Function archive 

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

Write a zip archive of the tree at spec to <folder>/repo.zip and return the path.

spec is any rev-spec gix can resolve — fully-qualified ref, short branch, tag, or SHA. Uses gix-archive’s native zip writer via Repository::worktree_archive; no subprocess.

§Errors

Returns GitError if spec cannot be resolved, the object cannot be peeled to a tree, or writing the zip file fails.