Skip to main content

extract_tag_tree

Function extract_tag_tree 

Source
pub fn extract_tag_tree(
    root: &Path,
    tag: &str,
    dir: &Path,
    fetch: &FetchDefault,
) -> Result<PathBuf>
Expand description

Materialize the repository tree at release tag tag into dir, returning the path inside dir that corresponds to root.

Looks up refs/tags/<tag> locally first. When absent and the repository has an origin remote, fetches refs/tags/<tag> alone through fetch (depth 1 on a shallow clone, NoChange on a full clone so full history is preserved). Regular files keep their executable bit and symlinks are skipped, matching MergeBase::write_to.

ยงErrors

Returns an error when root is outside a git repository, when tag is empty or exists neither locally nor on origin, or when the tree cannot be read or written.