jupyterhub / nbgitpuller

Jupyter server extension to sync a git repository one-way to a local path
https://nbgitpuller.readthedocs.io
BSD 3-Clause "New" or "Revised" License
205 stars 84 forks source link

Changing default branch makes all tests fail #283

Open jdmansour opened 1 year ago

jdmansour commented 1 year ago

Bug description

If you have changed the default branch name on your computer, as git init now suggests, all nbgitpuller tests fail.

How to reproduce

# The following fails:
git config --global init.defaultBranch main
python -m pytest tests/test_gitpuller.py

# This works again:
git config --global init.defaultBranch master
python -m pytest tests/test_gitpuller.py

I think this is because repohelpers.py hardcodes the master branch name, but when creating test repos doesn't specify a name. I'll look into it next week, it should not be too hard.

consideRatio commented 1 year ago

Ah nice work figuring that out!!