summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Berg <sebastian@sipsolutions.net>2021-03-07 15:05:35 -0600
committerSebastian Berg <sebastian@sipsolutions.net>2021-03-07 16:21:31 -0600
commit5631e8ee5aeea8fe645ee46aa12f76ecff1badf2 (patch)
treeeed854906503d432e3e03117a8e946f21dd746aa
parent516a0ce17153ffd3153bc9427869bff2b58e329a (diff)
downloadnumpy-5631e8ee5aeea8fe645ee46aa12f76ecff1badf2.tar.gz
CI: Do not pass original branch name to `git branch -m main`
Should fix the current failure that "master" does not exist. I am a bit curious why master does not exist, maybe the CircleCI git is set up to use some other default. Move the branch rename to after the commit, to make sure that the fact that the branch is empty (and `git branch` also) cannot influence the result. [ci-skip]
-rwxr-xr-xtools/ci/push_docs_to_repo.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/ci/push_docs_to_repo.py b/tools/ci/push_docs_to_repo.py
index 00c4f7074..058f748ec 100755
--- a/tools/ci/push_docs_to_repo.py
+++ b/tools/ci/push_docs_to_repo.py
@@ -45,7 +45,9 @@ workdir = tempfile.mkdtemp()
os.chdir(workdir)
run(['git', 'init'])
-run(['git', 'branch', '-m', 'master', 'main'])
+# ensure the working branch is called "main"
+# (`--initial-branch=main` appared to have failed on older git versions):
+run(['git', 'checkout', '-b', 'main'])
run(['git', 'remote', 'add', 'origin', args.remote])
run(['git', 'config', '--local', 'user.name', args.committer])
run(['git', 'config', '--local', 'user.email', args.email])