Skip to content

Commit c1319d7

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 f85e5e0 commit c1319d7

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
@@ -185,7 +185,8 @@ def clone_needs_extra_fetch?
185185
_, err, status = capture(command, nil)
186186
return extra_ref if status.success?
187187

188-
if err.include?("Could not find remote branch")
188+
if err.include?("Could not find remote branch") || # git up to 2.49
189+
err.include?("Remote branch #{branch_option} not found") # git 2.49 or higher
189190
raise MissingGitRevisionError.new(command_with_no_credentials, nil, explicit_ref, credential_filtered_uri)
190191
else
191192
idx = command.index("--depth")
@@ -262,7 +263,7 @@ def fully_qualified_ref
262263
end
263264

264265
def not_pinned?
265-
branch || tag || ref.nil?
266+
branch_option || ref.nil?
266267
end
267268

268269
def pinned_to_full_sha?
@@ -426,7 +427,7 @@ def extra_clone_args
426427
# anyways.
427428
return args if @revision
428429

429-
args += ["--branch", branch || tag] if branch || tag
430+
args += ["--branch", branch_option] if branch_option
430431
args
431432
end
432433

@@ -442,6 +443,10 @@ def extra_fetch_args(ref)
442443
extra_args
443444
end
444445

446+
def branch_option
447+
branch || tag
448+
end
449+
445450
def full_clone?
446451
depth.nil?
447452
end

0 commit comments

Comments
 (0)