audit: Fix Regexp for stripping .git from repo URLs

- [For a formula named
  turbogit](https://github.com/Homebrew/homebrew-core/pull/55208), we
  didn't see any of the notability checks fail CI.
- The repo name was getting truncated to `turb`, which didn't exist, so
  the audit didn't return anything for this check.
- The Regexp to strip `.git` from the end of was not escaping the `.`,
  so it would match anything ending in `git`, not a literal `.git`.
This commit is contained in:
Issy Long 2020-05-25 12:18:41 +01:00
parent b9b51421f4
commit 0cced8e7bd
No known key found for this signature in database
GPG Key ID: 8247C390DADC67D4

View File

@ -597,7 +597,7 @@ module Homebrew
_, user, repo = *regex.match(formula.homepage) unless user
return if !user || !repo
repo.gsub!(/.git$/, "")
repo.delete_suffix!(".git")
[user, repo]
end