From 81a760921320b6508458d6cdbe4c73b3e01b14b3 Mon Sep 17 00:00:00 2001 From: Zhiming Wang Date: Sat, 18 Feb 2017 10:16:59 -0500 Subject: [PATCH] bump-formula-pr: improve duplicate detection Reduce the chance of false flagging by making sure that the existing pr surfaced by GitHub.issues_for_formula actually contains the exact formula name in its title. --- Library/Homebrew/dev-cmd/bump-formula-pr.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/dev-cmd/bump-formula-pr.rb b/Library/Homebrew/dev-cmd/bump-formula-pr.rb index ea2daf1c42..bfe9c77767 100644 --- a/Library/Homebrew/dev-cmd/bump-formula-pr.rb +++ b/Library/Homebrew/dev-cmd/bump-formula-pr.rb @@ -80,7 +80,8 @@ module Homebrew def fetch_pull_requests(formula) GitHub.issues_for_formula(formula.name, tap: formula.tap).select do |pr| - pr["html_url"].include?("/pull/") + pr["html_url"].include?("/pull/") && + /(^|\s)#{Regexp.quote(formula.name)}(:|\s|$)/i =~ pr["title"] end rescue GitHub::RateLimitExceededError => e opoo e.message