From 6a09f0b19cdf0e53adbe5ce0ffc7deb8183a4310 Mon Sep 17 00:00:00 2001 From: Michael Kelly Date: Tue, 12 Aug 2025 00:07:27 -0700 Subject: [PATCH] Don't treat + as a special character for queries If we treat `+` as a special character for queries we run into the problem that we can't create queries like: topic:me+topic AND project:Baz This appears to be equivalent to : topic:me+topic+AND+project:Baz Instead of treating `+` as a special character we can just ensure that queries have the former form. --- changes_test.go | 2 +- gerrit.go | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/changes_test.go b/changes_test.go index 18d0285..650246b 100644 --- a/changes_test.go +++ b/changes_test.go @@ -76,7 +76,7 @@ func ExampleChangesService_QueryChanges_withSymbols() { opt := &gerrit.QueryChangeOptions{} opt.Query = []string{ - "change:249244+status:merged", + "change:249244 status:merged", } opt.Limit = 2 opt.AdditionalFields = []string{"LABELS"} diff --git a/gerrit.go b/gerrit.go index 5dfa904..776cbfe 100644 --- a/gerrit.go +++ b/gerrit.go @@ -505,7 +505,6 @@ func CheckResponse(r *http.Response) error { // Gerrit. Note, Gerrit itself does not escape these values when using the // search box so we shouldn't escape them either. var queryParameterReplacements = map[string]string{ - "+": "GOGERRIT_URL_PLACEHOLDER_PLUS", ":": "GOGERRIT_URL_PLACEHOLDER_COLON"} // addOptions adds the parameters in opt as URL query parameters to s.