diff options
author | David RodrÃguez <[email protected]> | 2025-03-20 18:19:58 +0100 |
---|---|---|
committer | Hiroshi SHIBATA <[email protected]> | 2025-03-24 13:24:21 +0900 |
commit | a56c2fb37559bc2df39f9930d6174f8f82f65313 (patch) | |
tree | 9f9581d5360ab8800c8330f8048836d040136186 | |
parent | 469a0a4a08dc4b3d3b6387b1f569108cc0750f17 (diff) |
[rubygems/rubygems] Support git 2.49
One error message that we parse is now slightly different.
https://github.com/rubygems/rubygems/commit/758528791d
-rw-r--r-- | lib/bundler/source/git/git_proxy.rb | 11 |
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 53a9a78ddf..fdb738e52e 100644 --- a/lib/bundler/source/git/git_proxy.rb +++ b/lib/bundler/source/git/git_proxy.rb @@ -162,7 +162,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 raise GitCommandError.new(command_with_no_credentials, path, err) @@ -231,7 +232,7 @@ module Bundler end def not_pinned? - branch || tag || ref.nil? + branch_option || ref.nil? end def pinned_to_full_sha? @@ -389,7 +390,7 @@ module Bundler # anyways. return args if @revision - args += ["--branch", branch || tag] if branch || tag + args += ["--branch", branch_option] if branch_option args end @@ -405,6 +406,10 @@ module Bundler extra_args end + def branch_option + branch || tag + end + def full_clone? depth.nil? end |