fix fetching GitLab snapshots on repos with no tags

This commit fixes #242

Signed-off-by: Federico Damián Schonborn <federicoschonborn@disroot.org>
This commit is contained in:
Federico Damián Schonborn 2024-04-19 22:21:41 -03:00
parent 5a5f48412d
commit 46218bd11e
No known key found for this signature in database
GPG Key ID: E4F6F544DE9E29E8

View File

@ -52,7 +52,10 @@ def fetch_gitlab_snapshots(url: ParseResult, branch: str) -> list[Version]:
resp = urllib.request.urlopen(gitlab_url) resp = urllib.request.urlopen(gitlab_url)
commits = json.load(resp) commits = json.load(resp)
versions = fetch_gitlab_versions(url) try:
versions = fetch_gitlab_versions(url)
except VersionError:
versions = []
latest_version = versions[0].number if versions else "0" latest_version = versions[0].number if versions else "0"
for commit in commits: for commit in commits: