index: fix git-mirror size check for GitLab Pages

The test case had the wrong folder setup, this was confirmed on a production
repo setup.
This commit is contained in:
Hans-Christoph Steiner 2022-11-15 11:25:28 +01:00
parent 83335437b9
commit f24613b701
No known key found for this signature in database
GPG key ID: 3E177817BA1B9BFA
2 changed files with 5 additions and 3 deletions

View file

@ -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))