Fixed check git repositories

Signed-off-by: Dimitris Zlatanidis <d.zlatanidis@gmail.com>
This commit is contained in:
Dimitris Zlatanidis 2024-09-28 23:58:41 +03:00
parent 63cb9597c8
commit 2124bd47fd

View file

@ -172,11 +172,11 @@ class Repositories: # pylint: disable=[R0902]
path_parts = parsed_url.path.strip("/").split("/")
owner = path_parts[0]
repository_name: str = path_parts[1].replace('.git', '')
if 'github.com' in sbo_git_mirror and sbo_repo_path.is_dir():
if 'github.com' in sbo_git_mirror and Path(sbo_repo_path, '.git/').is_dir():
branch: str = utils.get_git_branch(sbo_repo_path)
sbo_repo_mirror: str = f'https://raw.githubusercontent.com/{owner}/{repository_name}/{branch}/'
if 'gitlab.com' in sbo_git_mirror and sbo_repo_path.is_dir():
if 'gitlab.com' in sbo_git_mirror and Path(sbo_repo_path, '.git/').is_dir():
branch: str = utils.get_git_branch(sbo_repo_path)
sbo_repo_mirror: str = f'https://gitlab.com/{owner}/{repository_name}/-/raw/{branch}/'
@ -191,11 +191,11 @@ class Repositories: # pylint: disable=[R0902]
owner = path_parts[0]
repository_name: str = path_parts[1].replace('.git', '')
if 'github.com' in ponce_git_mirror and ponce_repo_path.is_dir():
if 'github.com' in ponce_git_mirror and Path(ponce_repo_path, '.git/').is_dir():
branch: str = utils.get_git_branch(ponce_repo_path)
ponce_repo_mirror: str = f'https://raw.githubusercontent.com/{owner}/{repository_name}/{branch}/'
if 'gitlab.com' in ponce_git_mirror and ponce_repo_path.is_dir():
if 'gitlab.com' in ponce_git_mirror and Path(ponce_repo_path, '.git/').is_dir():
branch: str = utils.get_git_branch(ponce_repo_path)
ponce_repo_mirror: str = f'https://gitlab.com/{owner}/{repository_name}/-/raw/{branch}/'