diff options
| author | Xu Cheng | 2016-01-15 20:12:41 +0800 |
|---|---|---|
| committer | Xu Cheng | 2016-01-17 14:52:09 +0800 |
| commit | edca96de04ea49d20dc959b985f7b487dae8a45e (patch) | |
| tree | 05e7608604d24af88039951596da9fcec741e880 /Library | |
| parent | 09a79106d762bf5cf7c3623c3d27b4e1851fbb83 (diff) | |
| download | brew-edca96de04ea49d20dc959b985f7b487dae8a45e.tar.bz2 | |
test-bot: always use canonical formula name
Otherwise, we may get incorrect result when preforming set operations on
list of formula names.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/cmd/test-bot.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Library/Homebrew/cmd/test-bot.rb b/Library/Homebrew/cmd/test-bot.rb index e55a2a24c..b6887f542 100644 --- a/Library/Homebrew/cmd/test-bot.rb +++ b/Library/Homebrew/cmd/test-bot.rb @@ -217,8 +217,8 @@ module Homebrew @hash = argument elsif url_match = argument.match(HOMEBREW_PULL_OR_COMMIT_URL_REGEX) @url = url_match[0] - elsif safe_formulary(argument) - @formulae = [argument] + elsif canonical_formula_name = safe_formula_canonical_name(argument) + @formulae = [canonical_formula_name] else raise ArgumentError.new("#{argument} is not a pull request URL, commit URL or formula name.") end @@ -232,8 +232,8 @@ module Homebrew @hash == "HEAD" end - def safe_formulary(formula) - Formulary.factory formula + def safe_formula_canonical_name(formula_name) + Formulary.factory(formula_name).full_name rescue TapFormulaUnavailableError => e test "brew", "tap", e.tap.name retry unless steps.last.failed? @@ -266,9 +266,9 @@ module Homebrew "diff-tree", "-r", "--name-only", "--diff-filter=#{filter}", start_revision, end_revision, "--", path ).lines.map do |line| - file = line.chomp - next unless File.extname(file) == ".rb" - File.basename(file, ".rb") + file = Pathname.new line.chomp + next unless file.extname == ".rb" + @tap.formula_file_to_name(file) end.compact end |
