Merge pull request #10055 from MikeMcQuaid/fix-github-search

Fix GitHub search behaviour change
This commit is contained in:
Mike McQuaid 2020-12-18 13:47:26 +00:00 committed by GitHub
commit be893d5a56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -312,7 +312,14 @@ module GitHub
end
def search_code(**qualifiers)
search("code", **qualifiers)
matches = search("code", **qualifiers)
return matches if matches.blank?
matches.map do |match|
# .sub workaround for GitHub returning preceding /
match["path"] = match["path"].sub(%r{^/}, "")
match
end
end
def issues_for_formula(name, tap: CoreTap.instance, tap_full_name: tap.full_name, state: nil)