Skip to content

Commit 02c59d1

Browse files
authored
Merge pull request #17409 from Homebrew/contributions-fix-review-counts
Fix constructing search query strings with date ranges
2 parents 11f042e + a23dad7 commit 02c59d1

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

Library/Homebrew/utils/github.rb

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -151,17 +151,18 @@ def self.private_repo?(full_name)
151151
def self.search_query_string(*main_params, **qualifiers)
152152
params = main_params
153153

154-
if (args = qualifiers.fetch(:args, nil))
155-
params << if args.from && args.to
156-
"created:#{args.from}..#{args.to}"
157-
elsif args.from
158-
"created:>=#{args.from}"
159-
elsif args.to
160-
"created:<=#{args.to}"
161-
end
154+
from = qualifiers.fetch(:from, nil)
155+
to = qualifiers.fetch(:to, nil)
156+
157+
params << if from && to
158+
"created:#{from}..#{to}"
159+
elsif from
160+
"created:>=#{from}"
161+
elsif to
162+
"created:<=#{to}"
162163
end
163164

164-
params += qualifiers.except(:args).flat_map do |key, value|
165+
params += qualifiers.except(:args, :from, :to).flat_map do |key, value|
165166
Array(value).map { |v| "#{key.to_s.tr("_", "-")}:#{v}" }
166167
end
167168

0 commit comments

Comments
 (0)