diff --git a/fdroidserver/index.py b/fdroidserver/index.py index c788509d..500c2e9e 100644 --- a/fdroidserver/index.py +++ b/fdroidserver/index.py @@ -1438,7 +1438,8 @@ def get_mirror_service_urls(url): segments.extend([branch, folder]) urls.append('/'.join(segments)) elif hostname == "gitlab.com": - if common.get_dir_size(folder) <= common.GITLAB_COM_PAGES_MAX_SIZE: + git_mirror_path = os.path.join('git-mirror', folder) + if common.get_dir_size(git_mirror_path) <= common.GITLAB_COM_PAGES_MAX_SIZE: # Gitlab-like Pages segments "https://user.gitlab.io/repo/folder" gitlab_pages = ["https:", "", user + ".gitlab.io", repo, folder] urls.append('/'.join(gitlab_pages)) diff --git a/tests/index.TestCase b/tests/index.TestCase index b04d81c0..6e63ffcf 100755 --- a/tests/index.TestCase +++ b/tests/index.TestCase @@ -416,8 +416,9 @@ class IndexTest(unittest.TestCase): def test_gitlab_get_mirror_service_urls(self): with tempfile.TemporaryDirectory() as tmpdir, TmpCwd(tmpdir): - os.mkdir('fdroid') - with Path('fdroid/placeholder').open('w') as fp: + git_mirror_path = Path('git-mirror/fdroid') + git_mirror_path.mkdir(parents=True) + with (git_mirror_path / 'placeholder').open('w') as fp: fp.write(' ') for url in [ 'git@gitlab.com:group/project',