-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running tests fails if git's init.defaultbranch
is not set to master
#2007
Comments
Had a look at several possible ways to fix and have no idea what's the right one. Workaround's annoying but good enough for what I came to do. |
Thanks for the report. This is actually an issue I ran into when trying to change the branch name for the gollum repository to |
I've also run into this issue. To work around it, I set my local git config for the Gollum repo(s):
But I think this isn't really a totally foolproof way of dealing with the issue. And I don't think it would be right to commit any git config to the repository. That said, we could at least add that in the |
That seems like a good temporary solution! Anyone have a moment to add this to CONTRIBUTING? |
I’d be happy to do it in the next couple of days. I will also add a couple of sentences context about why this might be necessary in 2023. |
✅ Please read the CONTRIBUTION GUIDELINES before submitting!
Describe the bug
12 tests in
test_page_view.rb
fail with aRugged::ReferenceError: reference 'refs/heads/master' not found
error if you've setinit.defaultbranch
to anything other thanmaster
.This seems to be because they're cloning
test/examples/empty.git
which has no branches in itsrefs/heads
which causes clone to useinit.defaultbranch
to create the first branch in the cloned test directory, and the tests somehow require that branch to be namedmaster
. Workaround is, of course, pull that out of your config or change the value tomaster
.To Reproduce
Steps to reproduce the behavior:
... and see many errors.
Expected behavior
Didn't expect the default branch choice to break tests.
Environment Info
The text was updated successfully, but these errors were encountered: