From 9c30b087c4454550ec61c6e76c5acbbda4dc9393 Mon Sep 17 00:00:00 2001 From: proletarius101 Date: Sun, 2 Jun 2024 23:37:06 +0800 Subject: [PATCH] fix(deploy): fatal: A branch named 'full' already exists. --- fdroidserver/deploy.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fdroidserver/deploy.py b/fdroidserver/deploy.py index eeec69e8..545ba867 100644 --- a/fdroidserver/deploy.py +++ b/fdroidserver/deploy.py @@ -730,7 +730,10 @@ def upload_to_servergitmirror(mirror_config: Dict[str, str], local_branch_name = 'index_only' else: local_branch_name = 'full' - local_repo.git.switch('-c', local_branch_name) + if local_branch_name in local_repo.heads: + local_repo.git.switch(local_branch_name) + else: + local_repo.git.switch('-c', local_branch_name) remote_branch_name = GIT_BRANCH remote_url = mirror_config['url']