Skip to content
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

Support repositories with default branch not named master #4224

Merged
merged 2 commits into from
Jan 7, 2021

Conversation

deivid-rodriguez
Copy link
Member

@deivid-rodriguez deivid-rodriguez commented Dec 31, 2020

What was the end-user or developer problem that led to this PR?

Bundler doesn't support non-master default branches, so you can't currently point to, for example, simplecov's repo, unless you add an explicit branch: => "main" to your git sources configuration.

Bundler should just work in this case without having to make the default branch explicit.

What is your fix for the problem, implemented in this PR?

My fix is to make sure the code doesn't assume a specific branch until we have actually cloned the repository. This means that when a git sources is printed, it no longer includes "master" if the source is only present in the Gemfile and has not yet been installed.

Fixes #4009.

Make sure the following tasks are checked

@simi
Copy link
Member

simi commented Jan 5, 2021

If I understand this well, this also fixes "bug" when master branch is present, but it is not default and is still picked when no branch is specified. It will pick correct default branch even non-default master one is present. 💪

@deivid-rodriguez
Copy link
Member Author

Now that you mention it, yeah, it sounds like that's what the old code was doing!

@deivid-rodriguez
Copy link
Member Author

It should be ready now unless CI proves me wrong!

@deivid-rodriguez
Copy link
Member Author

Thanks @simi! Since #4233 changes the same area of the code, I gave this a final rebase just to make sure the PRs don't semantically conflict somehow. I'll merge after CI 👍.

@deivid-rodriguez
Copy link
Member Author

CI got a flaky issue on jruby which I'm trying to address at #4235. I'll rebasing to see how this plays with the latest CI additions, and then merge.

Bundler 3 no longer prints these messages, but we can force them with `--verbose`.
… master

Without having to pass an explicit `:branch` argument.

Now git source string representation no longer shows branch information
unless the repository has already been cloned and we know what the
default branch is.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using main branch as default I get that Revision master does not exist
3 participants