swh.loader.git.utils module#
Utilities helper functions
- swh.loader.git.utils.init_git_repo_from_archive(project_name, archive_path, root_temp_dir='/tmp')[source]#
Given a path to an archive containing a git repository.
Uncompress that archive to a temporary location and returns the path.
If any problem whatsoever is raised, clean up the temporary location.
- Parameters:
- Returns
A tuple: - temporary folder: containing the mounted repository - repo_path, path to the mounted repository inside the temporary folder
- Raises
ValueError in case of failure to run the command to uncompress
- swh.loader.git.utils.check_date_time(timestamp)[source]#
Check date time for overflow errors.
- Parameters:
timestamp (timestamp) – Timestamp in seconds
- Raises:
Any error raised by datetime fromtimestamp conversion error. –
- swh.loader.git.utils.ignore_branch_name(branch_name: bytes) bool [source]#
Should the git loader ignore the branch named branch_name?