Only optimize for the core tap
This commit is contained in:
parent
c787df5294
commit
2601cc410b
@ -154,6 +154,8 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Optimization for the core tap which has many monthly commits
|
||||||
|
if tap.core_tap?
|
||||||
# Check if the formula has been deleted in the last month.
|
# Check if the formula has been deleted in the last month.
|
||||||
diff_command = ["git", "diff", "--diff-filter=D", "--name-only",
|
diff_command = ["git", "diff", "--diff-filter=D", "--name-only",
|
||||||
"@{'1 month ago'}", "--", relative_path]
|
"@{'1 month ago'}", "--", relative_path]
|
||||||
@ -163,6 +165,7 @@ module Homebrew
|
|||||||
ofail "No previously deleted formula found." unless silent
|
ofail "No previously deleted formula found." unless silent
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# Find commit where formula was deleted in the last month.
|
# Find commit where formula was deleted in the last month.
|
||||||
log_command = "git log --since='1 month ago' --diff-filter=D " \
|
log_command = "git log --since='1 month ago' --diff-filter=D " \
|
||||||
|
|||||||
@ -75,6 +75,7 @@ describe Homebrew::MissingFormula do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
shared_examples "it detects deleted formulae" do
|
||||||
context "with a deleted formula" do
|
context "with a deleted formula" do
|
||||||
let(:formula) { "homebrew/foo/deleted-formula" }
|
let(:formula) { "homebrew/foo/deleted-formula" }
|
||||||
|
|
||||||
@ -88,6 +89,17 @@ describe Homebrew::MissingFormula do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
include_examples "it detects deleted formulae"
|
||||||
|
|
||||||
|
describe "on the core tap" do
|
||||||
|
before do
|
||||||
|
allow_any_instance_of(Tap).to receive(:core_tap?).and_return(true)
|
||||||
|
end
|
||||||
|
|
||||||
|
include_examples "it detects deleted formulae"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
describe "::cask_reason", :cask do
|
describe "::cask_reason", :cask do
|
||||||
subject { described_class.cask_reason(formula, show_info: show_info) }
|
subject { described_class.cask_reason(formula, show_info: show_info) }
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user