diff --git a/fdroidserver/deploy.py b/fdroidserver/deploy.py index fc9c8658..c1423397 100644 --- a/fdroidserver/deploy.py +++ b/fdroidserver/deploy.py @@ -25,8 +25,9 @@ import re import subprocess import time import urllib +from git import Optional import yaml -from argparse import ArgumentParser +from argparse import ArgumentParser, Namespace import logging from shlex import split import shutil @@ -37,6 +38,7 @@ from . import index from .exception import FDroidException config = None +options: Optional[Namespace] = None start_timestamp = time.gmtime() GIT_BRANCH = 'master' @@ -685,7 +687,7 @@ def update_servergitmirrors(servergitmirrors, repo_section): progress = None repo = git.Repo.init(git_mirror_path, initial_branch=GIT_BRANCH) - initial_commit_ref = repo.head.ref + initial_commit_ref = repo.head.commit enabled_remotes = [] for d in servergitmirrors: @@ -775,6 +777,7 @@ def update_servergitmirrors(servergitmirrors, repo_section): else: logging.debug(remote.url + ': ' + pushinfo.summary) + # Reset the repository to the initial commit so we can choose which files to commit to the next remote repo.head.reset(initial_commit_ref, index=True, working_tree=True) if progress: