You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have recently changed the default branch in a number of my gem repositories from master to main. In doing so, this seems to have broken updates from dependent projects which use a git source (with no explicit branch) in their Gemfiles.
Running bundle update with the explicit branch option in place does bring in the new changes, but when it is removed, a subsequent bundle update reverts it back to the original default branch.
If this isn't an easy fix within bundler itself, is there an easy way to clear the cached git checkout? I've scoured the command options and couldn't find a relevant one that worked.
If not included with the output of your command, run bundle env and paste the output below
In case it is relevant:
Environment
Bundler 2.3.19
Platforms ruby, x86_64-darwin-21
Ruby 2.7.5p203 (2021-11-24 revision f69aeb83146be640995753667fdd6c6f157527f5) [x86_64-darwin-21]
Full Path /Users/sam/.rvm/rubies/ruby-2.7.5/bin/ruby
Config Dir /Users/sam/.rvm/rubies/ruby-2.7.5/etc
RubyGems 3.1.6
Gem Home /Users/sam/.rvm/gems/ruby-2.7.5
Gem Path /Users/sam/.rvm/gems/ruby-2.7.5:/Users/sam/.rvm/rubies/ruby-2.7.5/lib/ruby/gems/2.7.0
User Home /Users/sam
User Path /Users/sam/.gem/ruby/2.7.0
Bin Dir /Users/sam/.rvm/gems/ruby-2.7.5/bin
Tools
Git 2.32.1 (Apple Git-133)
RVM 1.29.12 (latest)
rbenv not installed
chruby not installed
rubygems-bundler (1.4.5)
Bundler Build Metadata
Built At 2022-07-27
Git SHA 4f496f93e6
Released Version true
Bundler settings
gem.changelog
Set for the current user (/Users/sam/.bundle/config): true
gem.ci
Set for the current user (/Users/sam/.bundle/config): false
gem.coc
Set for the current user (/Users/sam/.bundle/config): false
gem.linter
Set for the current user (/Users/sam/.bundle/config): false
gem.mit
Set for the current user (/Users/sam/.bundle/config): false
gem.test
Set for the current user (/Users/sam/.bundle/config): false
Hi @spohlenz. This sounds indeed be tricky to implement, I think we might need to add a git remote set-head origin --auto on the bare clone, but I doubt it's as simple as that.
I think the cache folder you're looking for is at /Users/sam/.rvm/gems/ruby-2.7.5/cache/bundler/git/test-gem-*. Removing that and rerunning bundle update may fix things.
Describe the problem as clearly as you can
I have recently changed the default branch in a number of my gem repositories from
master
tomain
. In doing so, this seems to have broken updates from dependent projects which use a git source (with no explicit branch) in their Gemfiles.Post steps to reproduce the problem
bundle gem
) and push to GitHub. I've used https://github.com/spohlenz/test_gem.bundle install
.bundle update
within the dependent project. TheGemfile.lock
still references the old default branch and commit pushed in step 3 isn't reflected.I thought I could perhaps explicitly specify a branch for the repo in the Gemfile, and then remove it. e.g.
Running
bundle update
with the explicit branch option in place does bring in the new changes, but when it is removed, a subsequentbundle update
reverts it back to the original default branch.If this isn't an easy fix within bundler itself, is there an easy way to clear the cached git checkout? I've scoured the command options and couldn't find a relevant one that worked.
If not included with the output of your command, run
bundle env
and paste the output belowIn case it is relevant:
Environment
Bundler Build Metadata
Bundler settings
Gemfile
Gemfile.lock
The text was updated successfully, but these errors were encountered: