diff --git a/Library/Homebrew/cmd/tap-info.rb b/Library/Homebrew/cmd/tap-info.rb index e7d1dbf791..03d414d3c7 100644 --- a/Library/Homebrew/cmd/tap-info.rb +++ b/Library/Homebrew/cmd/tap-info.rb @@ -69,7 +69,6 @@ module Homebrew puts unless i.zero? info = "#{tap}: " if tap.installed? - info += tap.pinned? ? "pinned" : "unpinned" info += ", private" if tap.private? info += if (contents = tap.contents).empty? ", no commands/casks/formulae" diff --git a/Library/Homebrew/exceptions.rb b/Library/Homebrew/exceptions.rb index ba8490734a..49e05e0484 100644 --- a/Library/Homebrew/exceptions.rb +++ b/Library/Homebrew/exceptions.rb @@ -247,17 +247,6 @@ class TapAlreadyTappedError < RuntimeError end end -class TapPinStatusError < RuntimeError - attr_reader :name, :pinned - - def initialize(name, pinned) - @name = name - @pinned = pinned - - super pinned ? "#{name} is already pinned." : "#{name} is already unpinned." - end -end - class OperationInProgressError < RuntimeError def initialize(name) message = <<~EOS diff --git a/Library/Homebrew/tap.rb b/Library/Homebrew/tap.rb index cf5a7bb61e..f9f6779210 100644 --- a/Library/Homebrew/tap.rb +++ b/Library/Homebrew/tap.rb @@ -500,26 +500,6 @@ class Tap @pinned = pinned_symlink_path.directory? end - # Pin this {Tap}. - def pin - raise TapUnavailableError, name unless installed? - raise TapPinStatusError.new(name, true) if pinned? - - pinned_symlink_path.make_relative_symlink(path) - @pinned = true - end - - # Unpin this {Tap}. - def unpin - raise TapUnavailableError, name unless installed? - raise TapPinStatusError.new(name, false) unless pinned? - - pinned_symlink_path.delete - pinned_symlink_path.parent.rmdir_if_possible - pinned_symlink_path.parent.parent.rmdir_if_possible - @pinned = false - end - def to_hash hash = { "name" => name, @@ -533,7 +513,6 @@ class Tap "cask_tokens" => cask_tokens, "cask_files" => cask_files.map(&:to_s), "command_files" => command_files.map(&:to_s), - "pinned" => pinned?, } if installed? diff --git a/Library/Homebrew/test/exceptions_spec.rb b/Library/Homebrew/test/exceptions_spec.rb index 79dba60a4e..536c63baa1 100644 --- a/Library/Homebrew/test/exceptions_spec.rb +++ b/Library/Homebrew/test/exceptions_spec.rb @@ -117,20 +117,6 @@ describe TapAlreadyTappedError do its(:to_s) { is_expected.to eq("Tap foo already tapped.\n") } end -describe TapPinStatusError do - context "pinned" do - subject { described_class.new("foo", true) } - - its(:to_s) { is_expected.to eq("foo is already pinned.") } - end - - context "unpinned" do - subject { described_class.new("foo", false) } - - its(:to_s) { is_expected.to eq("foo is already unpinned.") } - end -end - describe BuildError do subject { described_class.new(formula, "badprg", %w[arg1 arg2], {}) } diff --git a/Library/Homebrew/test/tap_spec.rb b/Library/Homebrew/test/tap_spec.rb index 25d3552bad..19478511bd 100644 --- a/Library/Homebrew/test/tap_spec.rb +++ b/Library/Homebrew/test/tap_spec.rb @@ -304,16 +304,6 @@ describe Tap do (HOMEBREW_PREFIX/"share").rmtree if (HOMEBREW_PREFIX/"share").exist? end - specify "#pin and #unpin" do - expect(subject).not_to be_pinned - expect { subject.unpin }.to raise_error(TapPinStatusError) - subject.pin - expect(subject).to be_pinned - expect { subject.pin }.to raise_error(TapPinStatusError) - subject.unpin - expect(subject).not_to be_pinned - end - specify "#config" do setup_git_repo diff --git a/completions/bash/brew b/completions/bash/brew index 25014fe940..226b0a3521 100644 --- a/completions/bash/brew +++ b/completions/bash/brew @@ -876,7 +876,6 @@ _brew() { switch) _brew_switch ;; tap) _brew_tap ;; tap-info) _brew_tap_info ;; - tap-pin) __brew_complete_tapped ;; tap-new) _brew_tap_new ;; tap-unpin) _brew_tap_unpin ;; test) __brew_complete_installed ;; diff --git a/completions/fish/brew.fish b/completions/fish/brew.fish index aeb394daf5..6f54442595 100644 --- a/completions/fish/brew.fish +++ b/completions/fish/brew.fish @@ -532,14 +532,6 @@ __fish_brew_complete_arg 'tap-info; and not __fish_brew_opt --installed' -l inst __fish_brew_complete_arg 'tap-info; and not __fish_brew_opt --json=v1' -l json=v1 -d "Format output in JSON format" -__fish_brew_complete_cmd 'tap-pin' "Prioritize tap's formulae over core" -__fish_brew_complete_arg 'tap-pin' -a '(__fish_brew_suggest_taps_installed)' - - -__fish_brew_complete_cmd 'tap-unpin' "Don't prioritize tap's formulae over core anymore" -__fish_brew_complete_arg 'tap-unpin' -a '(__fish_brew_suggest_taps_pinned)' - - __fish_brew_complete_cmd 'uninstall' "Uninstall formula" # FIXME: uninstall has a weird alias uninstal (with single l), probably it should also be supported __fish_brew_complete_arg 'uninstall remove rm' -a '(__fish_brew_suggest_formulae_installed)' diff --git a/completions/zsh/_brew b/completions/zsh/_brew index ff75d1ab09..742fda0c41 100644 --- a/completions/zsh/_brew +++ b/completions/zsh/_brew @@ -123,8 +123,6 @@ __brew_common_commands() { 'switch:switch between different versions of a formula' 'tap:tap a new formula repository from GitHub, or list existing taps' 'tap-info:information about a tap' - 'tap-pin:pin a tap' - 'tap-unpin:unpin a tap' 'test-bot:test a formula and build a bottle' 'uninstall:uninstall a formula' 'unlink:unlink a formula' @@ -679,11 +677,6 @@ _brew_tap_info() { '(--installed)*:taps:__brew_installed_taps' } -# brew tap-pin tap: -_brew_tap_pin() { - __brew_installed_taps -} - # brew tap_readme [-v] name: # TODO missing argument docs (verbose perhaps) _brew_tap_readme() { @@ -692,11 +685,6 @@ _brew_tap_readme() { ':name: ' } -# brew tap-unpin tap: -_brew_tap_unpin() { - __brew_pinned_taps -} - # brew test [--devel|--HEAD] [--debug] [--keep-tmp] formulae: _brew_test() { _arguments \