From 46218bd11e847ab00c19733a8915f5db91362c73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Federico=20Dami=C3=A1n=20Schonborn?= Date: Fri, 19 Apr 2024 22:21:41 -0300 Subject: [PATCH] fix fetching GitLab snapshots on repos with no tags MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit fixes #242 Signed-off-by: Federico Damián Schonborn --- nix_update/version/gitlab.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nix_update/version/gitlab.py b/nix_update/version/gitlab.py index 6744dc9..2bc0703 100644 --- a/nix_update/version/gitlab.py +++ b/nix_update/version/gitlab.py @@ -52,7 +52,10 @@ def fetch_gitlab_snapshots(url: ParseResult, branch: str) -> list[Version]: resp = urllib.request.urlopen(gitlab_url) 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" for commit in commits: