Skip to main content

checkout_tag

Function checkout_tag 

Source
pub fn checkout_tag(repo_path: &Path, tag_name: &str) -> Result<TempDir, Error>
Expand description

Checks out the tree of tag_name into a fresh temporary directory.

Only git-tracked files at the tagged commit’s tree are written. Returns the TempDir; the directory is cleaned up on drop.

§Errors

Returns Error::OpenRepo if the repository cannot be opened, Error::TagNotFound if the tag does not exist, Error::Peel if the tag cannot be peeled to a tree, or I/O errors if the temporary directory or files cannot be created.