Skip to content

Commit a56c2fb

Browse files
deivid-rodriguezhsbt
authored andcommitted
[rubygems/rubygems] Support git 2.49
One error message that we parse is now slightly different. rubygems/rubygems@758528791d
1 parent 469a0a4 commit a56c2fb

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

lib/bundler/source/git/git_proxy.rb

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,8 @@ def clone_needs_extra_fetch?
162162
_, err, status = capture(command, nil)
163163
return extra_ref if status.success?
164164

165-
if err.include?("Could not find remote branch")
165+
if err.include?("Could not find remote branch") || # git up to 2.49
166+
err.include?("Remote branch #{branch_option} not found") # git 2.49 or higher
166167
raise MissingGitRevisionError.new(command_with_no_credentials, nil, explicit_ref, credential_filtered_uri)
167168
else
168169
raise GitCommandError.new(command_with_no_credentials, path, err)
@@ -231,7 +232,7 @@ def fully_qualified_ref
231232
end
232233

233234
def not_pinned?
234-
branch || tag || ref.nil?
235+
branch_option || ref.nil?
235236
end
236237

237238
def pinned_to_full_sha?
@@ -389,7 +390,7 @@ def extra_clone_args
389390
# anyways.
390391
return args if @revision
391392

392-
args += ["--branch", branch || tag] if branch || tag
393+
args += ["--branch", branch_option] if branch_option
393394
args
394395
end
395396

@@ -405,6 +406,10 @@ def extra_fetch_args
405406
extra_args
406407
end
407408

409+
def branch_option
410+
branch || tag
411+
end
412+
408413
def full_clone?
409414
depth.nil?
410415
end

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy