Project

General

Profile

« Previous | Next » 

Revision c1fb25f6

Added by deivid (David Rodríguez) about 2 years ago

[rubygems/rubygems] Don't run any git commands when sorting and comparing git sources

Previously, when sorting and comparing git Gemfile vs lockfile sources during
bundler/setup to figure out whether we need to re-resolve or not, we
would try to find the default branch if nothing more specific was
specified in the Gemfile.

If the git cache has been deleted thought, that would fail.

The error would still be swallowed (and the branch would simply not be
displayed), but trying to clone would still generate the side effect of
creating the parent folder for the clone.

That could affect non-writable systems that don't expect bundler/setup
to write to the filesystem at all.

To fix this, override Bundler::Source::Git#identifier to use
exclusively static information, so it does not even try to clone the
repo nor generate any side effects.

https://github.com/rubygems/rubygems/commit/582eb2ef39