aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/exceptions.rb
diff options
context:
space:
mode:
authorilovezfs2016-04-04 03:18:55 -0700
committerilovezfs2016-04-05 07:25:27 -0700
commitfad235d8e82ae57b2004429a0297f313aafa3186 (patch)
tree02b3a8bfbfa5c0ae7deafc0b70fdb52c6bff0b6e /Library/Homebrew/exceptions.rb
parent1b7e13df4f936dd318a23698b7b69bd2ca0e2487 (diff)
downloadbrew-fad235d8e82ae57b2004429a0297f313aafa3186.tar.bz2
tap: support --full even if installed
Makes `tap` re-runnable and unshallows when requested with `--full`. Tapping with a different URL raises an exception. The homebrew/core tap cannot be untapped with `untap` so running `brew tap --full homebrew/core` is now a built-in way to get a full clone of this tap without resorting to workarounds. Closes #17. Signed-off-by: ilovezfs <ilovezfs@icloud.com>
Diffstat (limited to 'Library/Homebrew/exceptions.rb')
-rw-r--r--Library/Homebrew/exceptions.rb29
1 files changed, 29 insertions, 0 deletions
diff --git a/Library/Homebrew/exceptions.rb b/Library/Homebrew/exceptions.rb
index 79cfac012..dfd60549d 100644
--- a/Library/Homebrew/exceptions.rb
+++ b/Library/Homebrew/exceptions.rb
@@ -119,6 +119,23 @@ class TapUnavailableError < RuntimeError
end
end
+class TapRemoteMismatchError < RuntimeError
+ attr_reader :name
+ attr_reader :expected_remote
+ attr_reader :actual_remote
+
+ def initialize(name, expected_remote, actual_remote)
+ @name = name
+ @expected_remote = expected_remote
+ @actual_remote = actual_remote
+
+ super <<-EOS.undent
+ Tap #{name} remote mismatch.
+ #{expected_remote} != #{actual_remote}
+ EOS
+ end
+end
+
class TapAlreadyTappedError < RuntimeError
attr_reader :name
@@ -131,6 +148,18 @@ class TapAlreadyTappedError < RuntimeError
end
end
+class TapAlreadyUnshallowError < RuntimeError
+ attr_reader :name
+
+ def initialize(name)
+ @name = name
+
+ super <<-EOS.undent
+ Tap #{name} already a full clone.
+ EOS
+ end
+end
+
class TapPinStatusError < RuntimeError
attr_reader :name, :pinned