aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd/log.rb
diff options
context:
space:
mode:
authorAdam Vandenberg2013-05-23 09:21:33 -0700
committerAdam Vandenberg2013-05-23 09:21:33 -0700
commit46d2b2165ab1f559e52d4b24cb86d96505a7f4f4 (patch)
treeef6d00ed8529b7c074b6dac4addbbbf2c2b7ee31 /Library/Homebrew/cmd/log.rb
parent9212e1b1ee44f8ecdc8a217c09b7316c21856c0a (diff)
downloadbrew-46d2b2165ab1f559e52d4b24cb86d96505a7f4f4.tar.bz2
Allow brew log on deleted formulae.
Closes Homebrew/homebrew#19995.
Diffstat (limited to 'Library/Homebrew/cmd/log.rb')
-rw-r--r--Library/Homebrew/cmd/log.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/Library/Homebrew/cmd/log.rb b/Library/Homebrew/cmd/log.rb
index 0fc65113e..5f0ef63c8 100644
--- a/Library/Homebrew/cmd/log.rb
+++ b/Library/Homebrew/cmd/log.rb
@@ -4,9 +4,14 @@ module Homebrew extend self
cd HOMEBREW_REPOSITORY
exec "git", "log", *ARGV.options_only
else
- path = ARGV.formulae.first.path.realpath
+ begin
+ path = ARGV.formulae.first.path.realpath
+ rescue FormulaUnavailableError
+ # Maybe the formula was deleted
+ path = HOMEBREW_REPOSITORY/"Library/Formula/#{ARGV.named.first}.rb"
+ end
cd path.dirname # supports taps
- exec "git", "log", *ARGV.options_only + [path]
+ exec "git", "log", *ARGV.options_only + ["--", path]
end
end
end