utils/github: Remove unnecessary .delete_prefix("/")

- This workaround was originally added in 2020. I have confirmed with
  https://api.github.com/search/code?q=brew+language%3Aruby+org:Homebrew that
  the `path` string no longer has a leading `/`.
This commit is contained in:
Issy Long 2023-02-26 00:50:34 +00:00
parent 550599d03b
commit 214e2102c3
No known key found for this signature in database
GPG Key ID: 8247C390DADC67D4

View File

@ -61,21 +61,7 @@ module GitHub
end
def search_code(repo: nil, user: "Homebrew", path: ["Formula", "Casks", "."], filename: nil, extension: "rb")
matches = search_results_items(
"code",
user: user,
path: path,
filename: filename,
extension: extension,
repo: repo,
)
return matches if matches.blank?
matches.map do |match|
# .sub workaround for GitHub returning preceding /
match["path"] = match["path"].delete_prefix("/")
match
end
search_results_items("code", user: user, path: path, filename: filename, extension: extension, repo: repo)
end
def issues_for_formula(name, tap: CoreTap.instance, tap_remote_repo: tap&.full_name, state: nil)