Skip to content
Snippets Groups Projects
Commit 4cd95652 authored by Simon Sigurdhsson's avatar Simon Sigurdhsson Committed by Mike McQuaid
Browse files

brew-pin: Fix bug in `FormulaPin#pinned?`


Since `pinned?` was using `File#exists?`, broken symlinks left by force-upgraded
formulae made `pinned?` return false while `pin` returned with an error because
it could not overwrite the broken link. This is fixed by using `File#symlink?`
instead, which returns true for broken symlinks and false only when they do not
exist.

Closes Homebrew/homebrew#18858.

Signed-off-by: default avatarMike McQuaid <mike@mikemcquaid.com>
parent 04013816
No related branches found
No related tags found
No related merge requests found
......@@ -27,7 +27,7 @@ class FormulaPin
end
def pinned?
@path.exist?
@path.symlink?
end
def pinable?
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment