lib/gitlab/client/search.rb in gitlab-4.12.0 vs lib/gitlab/client/search.rb in gitlab-4.13.0

- old
+ new

@@ -52,11 +52,15 @@ # # @param [Integer, String] project The ID or name of a project. # @param [String] scope The scope to search in. Currently these scopes are supported: issues, merge_requests, milestones, notes, wiki_blobs, commits, blobs. # @param [String] search The search query. # @return [Array<Gitlab::ObjectifiedHash>] Returns a list of responses depending on the requested scope. - def search_in_project(project, scope, search) + def search_in_project(project, scope, search, ref = nil) options = { scope: scope, search: search } + + # Add ref filter if provided - backward compatible with main project + options[:ref] = ref unless ref.nil? + get("/projects/#{url_encode project}/search", query: options) end end end