aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
authorJack Nagel2014-07-19 20:25:16 -0500
committerJack Nagel2014-07-19 20:25:32 -0500
commit26b8c5a27d4ee04c67353a8115cb296337b9ec4f (patch)
treef4760c84f3b5f083e8ca5229641bec5061eed512 /Library/Homebrew
parentefcfbcc98bdc24187a2b590fd54d1c51816dffa2 (diff)
downloadbrew-26b8c5a27d4ee04c67353a8115cb296337b9ec4f.tar.bz2
Improve pull request URL regexp
- use a regexp literal and avoid escaping forward slashes - escape the period in "github.com" - match only hex characters in the commit part - allow hyphen in usernames and repo names, matching what we allow for tap names - avoid unnecessary capture
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/global.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/Library/Homebrew/global.rb b/Library/Homebrew/global.rb
index 2659fb642..54102f4d5 100644
--- a/Library/Homebrew/global.rb
+++ b/Library/Homebrew/global.rb
@@ -98,7 +98,7 @@ module Homebrew
alias_method :failed?, :failed
end
-HOMEBREW_PULL_OR_COMMIT_URL_REGEX = 'https:\/\/github.com\/(\w+)\/homebrew(-\w+)?\/(pull\/(\d+)|commit\/\w{4,40})'
+HOMEBREW_PULL_OR_COMMIT_URL_REGEX = %r[https://github\.com/([\w-]+)/homebrew(-[\w-]+)?/(?:pull/(\d+)|commit/\h{4,40})]
require 'compat' unless ARGV.include? "--no-compat" or ENV['HOMEBREW_NO_COMPAT']