summaryrefslogtreecommitdiff
path: root/lib/bundler
diff options
context:
space:
mode:
authorDavid Rodríguez <[email protected]>2025-03-20 18:19:58 +0100
committerHiroshi SHIBATA <[email protected]>2025-03-24 13:25:07 +0900
commit3b78b888423f85e206f70909adaed9ecb5dfe900 (patch)
tree1228e39425f7959b43feb6bc7734aa5d560eaba9 /lib/bundler
parent6982b80a8bf236271de246adab1d9fca07cbb39c (diff)
[rubygems/rubygems] Support git 2.49
One error message that we parse is now slightly different. https://github.com/rubygems/rubygems/commit/758528791d
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/12968
Diffstat (limited to 'lib/bundler')
-rw-r--r--lib/bundler/source/git/git_proxy.rb11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/bundler/source/git/git_proxy.rb b/lib/bundler/source/git/git_proxy.rb
index e01c5876de..8230584260 100644
--- a/lib/bundler/source/git/git_proxy.rb
+++ b/lib/bundler/source/git/git_proxy.rb
@@ -185,7 +185,8 @@ module Bundler
_, err, status = capture(command, nil)
return extra_ref if status.success?
- if err.include?("Could not find remote branch")
+ if err.include?("Could not find remote branch") || # git up to 2.49
+ err.include?("Remote branch #{branch_option} not found") # git 2.49 or higher
raise MissingGitRevisionError.new(command_with_no_credentials, nil, explicit_ref, credential_filtered_uri)
else
idx = command.index("--depth")
@@ -262,7 +263,7 @@ module Bundler
end
def not_pinned?
- branch || tag || ref.nil?
+ branch_option || ref.nil?
end
def pinned_to_full_sha?
@@ -426,7 +427,7 @@ module Bundler
# anyways.
return args if @revision
- args += ["--branch", branch || tag] if branch || tag
+ args += ["--branch", branch_option] if branch_option
args
end
@@ -442,6 +443,10 @@ module Bundler
extra_args
end
+ def branch_option
+ branch || tag
+ end
+
def full_clone?
depth.nil?
end