aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/tap.rb
diff options
context:
space:
mode:
authorXu Cheng2016-04-19 15:18:54 +0800
committerXu Cheng2016-04-19 16:29:29 +0800
commit71b6e0aa18215cb956dceb13f0381da1131734c0 (patch)
tree91d40da39c3befc4a92c638ca356fb5a9f383f6f /Library/Homebrew/tap.rb
parent9b79f45e94805426c6bde47528063e5e505e2abd (diff)
downloadbrew-71b6e0aa18215cb956dceb13f0381da1131734c0.tar.bz2
Tap#install: better TapRemoteMismatchError check
* remote check requires `git` installed. * Do not perform check if user does not passing remote explicitly. Fixes #108
Diffstat (limited to 'Library/Homebrew/tap.rb')
-rw-r--r--Library/Homebrew/tap.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/Library/Homebrew/tap.rb b/Library/Homebrew/tap.rb
index 042f1af52..52e6136b6 100644
--- a/Library/Homebrew/tap.rb
+++ b/Library/Homebrew/tap.rb
@@ -188,7 +188,6 @@ class Tap
requested_remote = options[:clone_target] || "https://github.com/#{user}/homebrew-#{repo}"
if installed?
- raise TapRemoteMismatchError.new(name, @remote, requested_remote) unless remote == requested_remote
raise TapAlreadyTappedError, name unless full_clone
raise TapAlreadyUnshallowError, name unless shallow?
end
@@ -197,6 +196,10 @@ class Tap
Utils.ensure_git_installed!
if installed?
+ if options[:clone_target] && requested_remote != remote
+ raise TapRemoteMismatchError.new(name, @remote, requested_remote)
+ end
+
ohai "Unshallowing #{name}" unless quiet
args = %W[fetch --unshallow]
args << "-q" if quiet