git_interface.utils
Methods that don’t fit in their own file
- async git_interface.utils.clone_repo(git_repo, src, bare=False, mirror=False)
Clone an exiting repo, please note this method has no way of passing passwords+usernames
- param git_repo
Repo path to clone into
- param src
Where to clone from
- param bare
Use –bare git argument, defaults to False
- param mirror
Use –mirror git argument, defaults to False
- raises ValueError
Both bare and mirror are True
- raises GitException
Error to do with git
- Parameters
git_repo (Union[pathlib.Path, str]) –
src (str) –
- async git_interface.utils.get_archive(git_repo, archive_type, tree_ish='HEAD')
get a archive of a git repo
- param git_repo
Where the repo is
- param archive_type
What archive type will be created
- param tree_ish
What commit/branch to save, defaults to “HEAD”
- raises GitException
Error to do with git
- return
The content of the archive ready to write to a file
- Parameters
git_repo (Union[pathlib.Path, str]) –
archive_type (git_interface.datatypes.ArchiveTypes) –
tree_ish (str) –
- Return type
bytes
- async git_interface.utils.get_archive_buffered(git_repo, archive_type, tree_ish='HEAD')
get a archive of a git repo, but using a buffered read
- param git_repo
Where the repo is
- param archive_type
What archive type will be created
- param tree_ish
What commit/branch to save, defaults to “HEAD”
- raises GitException
Error to do with git
- yield
Each read content section
- Parameters
git_repo (Union[pathlib.Path, str]) –
archive_type (git_interface.datatypes.ArchiveTypes) –
tree_ish (str) –
- Return type
AsyncGenerator[bytes, None]
- async git_interface.utils.get_description(git_repo)
Gets the set description for a repo
- param git_repo
Path to the repo
- return
The description
- Parameters
git_repo (Union[pathlib.Path, str]) –
- Return type
collections.abc.Coroutine[Any, Any, str]
- async git_interface.utils.get_version()
Gets the git version
- raises GitException
Error to do with git
- return
The version
- Return type
collections.abc.Coroutine[Any, Any, str]
- async git_interface.utils.init_repo(repo_dir, repo_name, bare=True, default_branch=None)
Creates a new git repo in the directory with the given name, if bare the repo name will have .git added at the end.
- param repo_dir
Where the repo will be
- param repo_name
The name of the repo
- param bare
Whether the repo is bare, defaults to True
- param default_branch
The branch name to use, defaults to None
- raises AlreadyExistsException
A repo already exists
- raises GitException
Error to do with git
- Parameters
repo_dir (pathlib.Path) –
repo_name (str) –
bare (bool) –
default_branch (Optional[str]) –
- async git_interface.utils.run_maintenance(git_repo)
Run a maintenance git command to specified repo
- param git_repo
Where the repo is
- raises GitException
Error to do with git
- Parameters
git_repo (Union[pathlib.Path, str]) –
- async git_interface.utils.set_description(git_repo, description)
Sets the set description for a repo
- param git_repo
Path to the repo
- Parameters
git_repo (Union[pathlib.Path, str]) –
description (str) –