Git utilities¤
assert_git_repo ¤
get_latest_tag ¤
get_repo_root ¤
tmp_worktree ¤
Context manager that checks out the given reference in the given repository to a temporary worktree.
Parameters:
-
repo
¤str | Path
, default:'.'
) –Path to the repository (i.e. the directory containing the
.git
directory) -
ref
¤str
, default:'HEAD'
) –A Git reference such as a commit, tag or branch.
Yields:
-
Path
–The path to the temporary worktree.
Raises:
-
OSError
–If
repo
is not a valid.git
repository -
RuntimeError
–If the
git
executable is unavailable, or if it cannot create a worktree