diff options
Diffstat (limited to 'lib/bundler/source/git/git_proxy.rb')
-rw-r--r-- | lib/bundler/source/git/git_proxy.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/bundler/source/git/git_proxy.rb b/lib/bundler/source/git/git_proxy.rb index 2a7c8473f5..2a2b48053a 100644 --- a/lib/bundler/source/git/git_proxy.rb +++ b/lib/bundler/source/git/git_proxy.rb @@ -139,8 +139,8 @@ module Bundler out, err, status = capture(command, path) return out if status.success? - if err.include?("couldn't find remote ref") - raise MissingGitRevisionError.new(command_with_no_credentials, path, explicit_ref, credential_filtered_uri) + if err.include?("couldn't find remote ref") || err.include?("not our ref") + raise MissingGitRevisionError.new(command_with_no_credentials, path, commit || explicit_ref, credential_filtered_uri) else raise GitCommandError.new(command_with_no_credentials, path, err) end @@ -186,8 +186,6 @@ module Bundler end def refspec - commit = pinned_to_full_sha? ? ref : @revision - if commit @commit_ref = "refs/#{commit}-sha" return "#{commit}:#{@commit_ref}" @@ -206,6 +204,10 @@ module Bundler "#{reference}:#{reference}" end + def commit + @commit ||= pinned_to_full_sha? ? ref : @revision + end + def fully_qualified_ref if branch "refs/heads/#{branch}" |