From 214e2102c3d05978326c3f335a6fb2df718d5fa4 Mon Sep 17 00:00:00 2001 From: Issy Long Date: Sun, 26 Feb 2023 00:50:34 +0000 Subject: [PATCH] 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 `/`. --- Library/Homebrew/utils/github.rb | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/Library/Homebrew/utils/github.rb b/Library/Homebrew/utils/github.rb index aa4cfc2c37..93dbf5ba92 100644 --- a/Library/Homebrew/utils/github.rb +++ b/Library/Homebrew/utils/github.rb @@ -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)