fix: index only mode setting doesn't work if it follows a full mode config

This commit is contained in:
proletarius101 2024-04-06 14:53:54 +08:00
parent 2d267e6cbd
commit 96d1f4190f
No known key found for this signature in database
1 changed files with 5 additions and 3 deletions

View File

@ -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
import shutil
@ -36,7 +37,7 @@ from . import index
from .exception import FDroidException
config = None
options = None
options: Optional[Namespace] = None
start_timestamp = time.gmtime()
GIT_BRANCH = 'master'
@ -502,7 +503,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:
@ -585,6 +586,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: