From cacbe88b8c2211b0623bd400a7f7641d0c5c1431 Mon Sep 17 00:00:00 2001 From: Jochen Sprickerhof Date: Tue, 3 Aug 2021 11:38:24 +0200 Subject: [PATCH] Don't fail fdroid update on empty repository Steps to reproduce: $ git init $ fdroid update --create-key --- fdroidserver/common.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fdroidserver/common.py b/fdroidserver/common.py index 55f02955..b538dd85 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -892,7 +892,10 @@ def write_status_json(output, pretty=False, name=None): def get_head_commit_id(git_repo): """Get git commit ID for HEAD as a str.""" - return git_repo.head.commit.hexsha + try: + return git_repo.head.commit.hexsha + except ValueError: + return "None" def setup_vcs(app):