From 8f103172740547dde44e3b8365bdfbe7ea44154c Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Tue, 4 Feb 2025 16:39:02 +0000 Subject: [PATCH] Support listing translations on base commit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There will be no translation updates on the base commit, so don’t error out in that case. Signed-off-by: Philip Withnall --- gitlab-changelog.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gitlab-changelog.py b/gitlab-changelog.py index 8dec842..26656be 100644 --- a/gitlab-changelog.py +++ b/gitlab-changelog.py @@ -60,7 +60,10 @@ from gi.repository import GLib, GnomeDesktop # noqa: E402 def get_commit_translations(commit): """Return a potentially empty set of locale codes changed by this commit.""" - diff = commit.diff(commit.hexsha + '~1') + try: + diff = commit.diff(commit.hexsha + '~1') + except: + return set([]) locales = [] for item in diff: -- GitLab