deploy: ensure mirrors and binary transparency always create 'master'

If there was a global default on a machine that was something other than
'master', these things would crash with:

Traceback (most recent call last):
  File "/home/hans/code/fdroid/server/fdroid", line 22, in <module>
    fdroidserver.__main__.main()
  File "/home/hans/code/fdroid/server/fdroidserver/__main__.py", line 230, in main
    raise e
  File "/home/hans/code/fdroid/server/fdroidserver/__main__.py", line 211, in main
    mod.main()
  File "/home/hans/code/fdroid/server/fdroidserver/deploy.py", line 833, in main
    push_binary_transparency(BINARY_TRANSPARENCY_DIR,
  File "/home/hans/code/fdroid/server/fdroidserver/deploy.py", line 705, in push_binary_transparency
    local.pull('master')
  File "/usr/lib/python3/dist-packages/git/remote.py", line 1045, in pull
    res = self._get_fetch_info_from_stderr(proc, progress, kill_after_timeout=kill_after_timeout)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/git/remote.py", line 848, in _get_fetch_info_from_stderr
    proc.wait(stderr=stderr_text)
  File "/usr/lib/python3/dist-packages/git/cmd.py", line 604, in wait
    raise GitCommandError(remove_password_if_present(self.args), status, errstr)
git.exc.GitCommandError: Cmd('git') failed due to: exit code(1)
  cmdline: git pull -v -- local master
  stderr: 'fatal: couldn't find remote ref master'
This commit is contained in:
Hans-Christoph Steiner 2023-05-09 20:09:28 +02:00
parent 0735bfa7e5
commit f7830a41f1
4 changed files with 17 additions and 9 deletions

View file

@ -125,6 +125,10 @@ ubuntu_lts_ppa:
- apt-get update
- apt-get dist-upgrade
- apt-get install --install-recommends dexdump fdroidserver git jq python3-setuptools sdkmanager
# Test things work with a default branch other than 'master'
- git config --global init.defaultBranch thisisnotmasterormain
- cd tests
- ./run-tests