summaryrefslogtreecommitdiff
path: root/lib/bundler/source
diff options
context:
space:
mode:
authorHiroshi SHIBATA <[email protected]>2022-12-22 08:20:23 +0900
committerHiroshi SHIBATA <[email protected]>2022-12-24 16:57:07 +0900
commitf6620037ba1477d2c337d7b511f094d6d0fbb69c ()
tree4d8d38eaf97e6ca88162dd574e7871e1739f22ae /lib/bundler/source
parentd5635dfe36588b04d3dd6065ab4e422f51629b11 (diff)
Merge RubyGems-3.4.0 and Bundler-2.4.0
Notes: Merged: https://.com/ruby/ruby/pull/6987
-rw-r--r--lib/bundler/source/git/git_proxy.rb33
1 files changed, 14 insertions, 19 deletions
@@ -176,37 +176,32 @@ module Bundler
@depth = if !supports_fetching_unreachable_refs?
nil
- elsif not_pinned?
1
elsif ref.include?("~")
parsed_depth = ref.split("~").last
parsed_depth.to_i + 1
- elsif abbreviated_ref?
- nil
- else
- 1
end
end
def refspec
- if fully_qualified_ref
- "#{fully_qualified_ref}:#{fully_qualified_ref}"
- elsif ref.include?("~")
- parsed_ref = ref.split("~").first
- "#{parsed_ref}:#{parsed_ref}"
elsif ref.start_with?("refs/")
- "#{ref}:#{ref}"
- elsif abbreviated_ref?
- nil
- else
ref
end
end
def fully_qualified_ref
- return @fully_qualified_ref if defined?(@fully_qualified_ref)
-
- @fully_qualified_ref = if branch
"refs/heads/#{branch}"
elsif tag
"refs/tags/#{tag}"
@@ -219,8 +214,8 @@ module Bundler
branch || tag || ref.nil?
end
- def abbreviated_ref?
- ref =~ /\A\h+\z/ && ref !~ /\A\h{40}\z/
end
def legacy_locked_revision?