From 53bf6c7ce190410f0c0d1cc32eef6e6e5cffe344 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Wed, 18 Jun 2025 19:06:27 +0200 Subject: [PATCH] deploy: use master branch when working complete git-mirror repo The *-nightly git repo always uses the _master_ branch. The `index_only:` support maintains a separate local branch since its git repo should be as small as possible. The full repo should be maintained for mirrors not using `index_only:` so that when it force-pushes, it does not need to always push all the files, only the updated ones. So the full repo should be maintained in the _master_ branch, and only the `index_only` mirrors should have their own branch. This adds a test case to reproduce this error: https://gitlab.com/fdroid/fdroidclient/-/jobs/10347168516 This case also applies to any setup that used `servergitmirrors:` before the `index_only:` feature was added. This also applies to cases if the repo maintainer manually clones the *-nightly repo into _fdroid/git-mirror/_ --- fdroidserver/deploy.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/fdroidserver/deploy.py b/fdroidserver/deploy.py index ad108340..cc7d6c52 100644 --- a/fdroidserver/deploy.py +++ b/fdroidserver/deploy.py @@ -617,6 +617,13 @@ def update_servergitmirrors(servergitmirrors, repo_section): For history, there is the archive section, and there is the binary transparency log. + This will attempt to use the existing remote branch so that it does + not have to push all of the files in the repo each time. Old setups + or runs of `fdroid nightly` might use the "master" branch. For the + "index only" mode, it will recreate the branch from scratch each + time since usually all the files are changed. In any case, the + index files are small compared to the full repo. + """ from clint.textui import progress @@ -687,7 +694,7 @@ def update_servergitmirrors(servergitmirrors, repo_section): if is_index_only: local_branch_name = 'index_only' else: - local_branch_name = 'full' + local_branch_name = GIT_BRANCH if local_branch_name in repo.heads: repo.git.switch(local_branch_name) else: