diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2021-02-01 16:17:16 +0100 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2021-03-08 13:47:35 +0900 |
commit | 53468cc11147b0d285fc376fc546b677dad600ca (patch) | |
tree | eb9c97f544d089be2d324126b025b11f41a22c90 /lib/bundler/source/git.rb | |
parent | 2ab6b7a7516e1b2c48a66ce513afabb62d101461 (diff) |
Sync latest development version of bundler & rubygems
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/4143
Diffstat (limited to 'lib/bundler/source/git.rb')
-rw-r--r-- | lib/bundler/source/git.rb | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/lib/bundler/source/git.rb b/lib/bundler/source/git.rb index 0157995cb0..fb13ca0578 100644 --- a/lib/bundler/source/git.rb +++ b/lib/bundler/source/git.rb @@ -22,7 +22,7 @@ module Bundler @uri = options["uri"] || "" @safe_uri = URICredentialsFilter.credential_filtered_uri(@uri) @branch = options["branch"] - @ref = options["ref"] || options["branch"] || options["tag"] || "master" + @ref = options["ref"] || options["branch"] || options["tag"] @submodules = options["submodules"] @name = options["name"] @version = options["version"].to_s.strip.gsub("-", ".pre.") @@ -60,25 +60,27 @@ module Bundler alias_method :==, :eql? def to_s - at = if local? - path - elsif user_ref = options["ref"] - if ref =~ /\A[a-z0-9]{4,}\z/i - shortref_for_display(user_ref) + begin + at = if local? + path + elsif user_ref = options["ref"] + if ref =~ /\A[a-z0-9]{4,}\z/i + shortref_for_display(user_ref) + else + user_ref + end + elsif ref + ref else - user_ref + git_proxy.branch end - else - ref - end - rev = begin - "@#{shortref_for_display(revision)}" - rescue GitError - nil - end + rev = " (at #{at}@#{shortref_for_display(revision)})" + rescue GitError + "" + end - "#{@safe_uri} (at #{at}#{rev})" + "#{@safe_uri}#{rev}" end def name @@ -146,7 +148,7 @@ module Bundler changed = cached_revision && cached_revision != git_proxy.revision - if changed && !@unlocked && !git_proxy.contains?(cached_revision) + if !Bundler.settings[:disable_local_revision_check] && changed && !@unlocked && !git_proxy.contains?(cached_revision) raise GitError, "The Gemfile lock is pointing to revision #{shortref_for_display(cached_revision)} " \ "but the current branch in your local override for #{name} does not contain such commit. " \ "Please make sure your branch is up to date." |