From 2124bd47fd210701bce11b2551308d3af5e7276c Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Sat, 28 Sep 2024 23:58:41 +0300 Subject: [PATCH] Fixed check git repositories Signed-off-by: Dimitris Zlatanidis --- slpkg/repositories.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/slpkg/repositories.py b/slpkg/repositories.py index 80ed5788..b485b1e5 100644 --- a/slpkg/repositories.py +++ b/slpkg/repositories.py @@ -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}/'