diff options
author | David RodrÃguez <[email protected]> | 2019-04-10 11:58:30 +0200 |
---|---|---|
committer | Hiroshi SHIBATA <[email protected]> | 2019-08-03 09:29:56 +0900 |
commit | 4b1395ab4ae7b6b9e22362ccb08d103bdec744f4 () | |
tree | c8d699bba2a01d7b54be6d7a00a5465aaeec2159 | |
parent | e405aede09c090c7356bd2986793e0328f498e04 (diff) |
[bundler/bundler] Clearer MissingRevision git errors
https://.com/bundler/bundler/commit/b47d23edf5
-rw-r--r-- | lib/bundler/source/git/git_proxy.rb | 18 | ||||
-rw-r--r-- | spec/bundler/bundler/source/git/git_proxy_spec.rb | 7 |
2 files changed, 16 insertions, 9 deletions
@@ -26,7 +26,11 @@ module Bundler end class GitCommandError < GitError def initialize(command, path = nil, extra_info = nil) msg = String.new msg << "Git error: command `git #{command}` in directory #{SharedHelpers.pwd} has failed." msg << "\n#{extra_info}" if extra_info @@ -35,10 +39,10 @@ module Bundler end end - class MissingGitRevisionError < GitError - def initialize(ref, repo) msg = "Revision #{ref} does not exist in the repository #{repo}. Maybe you misspelled it?" - super msg end end @@ -63,8 +67,8 @@ module Bundler begin @revision ||= find_local_revision - rescue GitCommandError - raise MissingGitRevisionError.new(ref, URICredentialsFilter.credential_filtered_uri(uri)) end @revision @@ -135,8 +139,8 @@ module Bundler begin git "reset --hard #{@revision}" - rescue GitCommandError - raise MissingGitRevisionError.new(@revision, URICredentialsFilter.credential_filtered_uri(uri)) end if submodules @@ -136,8 +136,11 @@ RSpec.describe Bundler::Source::Git::GitProxy do expect(subject).not_to receive(:git) expect { subject.copy_to(destination, submodules) }. - to raise_error(Bundler::Source::Git::MissingGitRevisionError, - "Revision #{revision} does not exist in the repository #{uri}. Maybe you misspelled it?") end end end |