diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-10-01 08:30:21 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-10-01 08:30:21 +0000 |
commit | cec4f5a9e02751404fd1408b6d81078f409b750d (patch) | |
tree | e0269284018921fa6a8c32dc007c819075d50cfd /lib/rubygems/source/git.rb | |
parent | ffe920d674857087037327dc4075cd0c7e8e9fd1 (diff) |
* lib/rubygems: Update to RubyGems 2.4.2.
* test/rubygems: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47748 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/source/git.rb')
-rw-r--r-- | lib/rubygems/source/git.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/rubygems/source/git.rb b/lib/rubygems/source/git.rb index fb9cbce2fb..35c2270a74 100644 --- a/lib/rubygems/source/git.rb +++ b/lib/rubygems/source/git.rb @@ -178,9 +178,17 @@ class Gem::Source::Git < Gem::Source # Converts the git reference for the repository into a commit hash. def rev_parse # :nodoc: + hash = nil + Dir.chdir repo_cache_dir do - Gem::Util.popen(@git, 'rev-parse', @reference).strip + hash = Gem::Util.popen(@git, 'rev-parse', @reference).strip end + + raise Gem::Exception, + "unable to find reference #{@reference} in #{@repository}" unless + $?.success? + + hash end ## |