Skip to content

Commit 2efa400

Browse files
deivid-rodriguezhsbt
authored andcommitted
[rubygems/rubygems] Support git 2.49
One error message that we parse is now slightly different. ruby/rubygems@758528791d
1 parent 5b3970f commit 2efa400

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
@@ -179,7 +179,8 @@ def clone_needs_extra_fetch?
179179
_, err, status = capture(command, nil)
180180
return extra_ref if status.success?
181181

182-
if err.include?("Could not find remote branch")
182+
if err.include?("Could not find remote branch") || # git up to 2.49
183+
err.include?("Remote branch #{branch_option} not found") # git 2.49 or higher
183184
raise MissingGitRevisionError.new(command_with_no_credentials, nil, explicit_ref, credential_filtered_uri)
184185
else
185186
idx = command.index("--depth")
@@ -256,7 +257,7 @@ def fully_qualified_ref
256257
end
257258

258259
def not_pinned?
259-
branch || tag || ref.nil?
260+
branch_option || ref.nil?
260261
end
261262

262263
def pinned_to_full_sha?
@@ -420,7 +421,7 @@ def extra_clone_args
420421
# anyways.
421422
return args if @revision
422423

423-
args += ["--branch", branch || tag] if branch || tag
424+
args += ["--branch", branch_option] if branch_option
424425
args
425426
end
426427

@@ -436,6 +437,10 @@ def extra_fetch_args(ref)
436437
extra_args
437438
end
438439

440+
def branch_option
441+
branch || tag
442+
end
443+
439444
def full_clone?
440445
depth.nil?
441446
end

0 commit comments

Comments
 (0)