diff --git a/fdroidserver/deploy.py b/fdroidserver/deploy.py index d514e569..dd856c96 100644 --- a/fdroidserver/deploy.py +++ b/fdroidserver/deploy.py @@ -511,13 +511,15 @@ def update_servergitmirrors(servergitmirrors, repo_section): enabled_remotes = [] for d in servergitmirrors: index_only = d.get('index_only', False) + + # Use a separate branch for the index only mode as it needs a different set of files to commit if index_only: - # Use a separate branch for the index only mode as it needs a different set of files to commit - repo.create_head('index_only', initial_branch_ref) - repo.heads.index_only.checkout() + branch_name = 'index_only' else: - repo.create_head('full', initial_branch_ref) - repo.heads.full.checkout() + branch_name = 'full' + if not branch_name in repo.heads: + repo.create_head(branch_name, initial_branch_ref) + repo.heads[branch_name].checkout() remote_url = d['url'] name = REMOTE_HOSTNAME_REGEX.sub(r'\1', remote_url)