1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Update bundled bundler to 1.16.0.

* lib/bundler, spec/bundler: Merge bundler-1.16.0.
  * common.mk: rspec examples of bundler-1.16.0 needs require option.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
hsbt 2017-11-01 23:29:38 +00:00
parent ae49dbd392
commit be7b592912
1025 changed files with 13902 additions and 3180 deletions

View file

@ -1,4 +1,5 @@
# frozen_string_literal: true
require "shellwords"
require "tempfile"
module Bundler
@ -62,7 +63,7 @@ module Bundler
begin
@revision ||= find_local_revision
rescue GitCommandError
raise MissingGitRevisionError.new(ref, uri)
raise MissingGitRevisionError.new(ref, URICredentialsFilter.credential_filtered_uri(uri))
end
@revision
@ -90,18 +91,21 @@ module Bundler
end
def checkout
if path.exist?
return if has_revision_cached?
Bundler.ui.info "Fetching #{URICredentialsFilter.credential_filtered_uri(uri)}"
in_path do
git_retry %(fetch --force --quiet --tags #{uri_escaped_with_configured_credentials} "refs/heads/*:refs/heads/*")
end
else
Bundler.ui.info "Fetching #{URICredentialsFilter.credential_filtered_uri(uri)}"
return if path.exist? && has_revision_cached?
extra_ref = "#{Shellwords.shellescape(ref)}:#{Shellwords.shellescape(ref)}" if ref && ref.start_with?("refs/")
Bundler.ui.info "Fetching #{URICredentialsFilter.credential_filtered_uri(uri)}"
unless path.exist?
SharedHelpers.filesystem_access(path.dirname) do |p|
FileUtils.mkdir_p(p)
end
git_retry %(clone #{uri_escaped_with_configured_credentials} "#{path}" --bare --no-hardlinks --quiet)
return unless extra_ref
end
in_path do
git_retry %(fetch --force --quiet --tags #{uri_escaped_with_configured_credentials} "refs/heads/*:refs/heads/*" #{extra_ref})
end
end
@ -149,7 +153,7 @@ module Bundler
end
def git_retry(command)
Bundler::Retry.new("`git #{command}`", GitNotAllowedError).attempts do
Bundler::Retry.new("`git #{URICredentialsFilter.credential_filtered_string(command, uri)}`", GitNotAllowedError).attempts do
git(command)
end
end
@ -217,6 +221,7 @@ module Bundler
def in_path(&blk)
checkout unless path.exist?
_ = URICredentialsFilter # load it before we chdir
SharedHelpers.chdir(path, &blk)
end