summaryrefslogtreecommitdiff
path: root/lib/api
diff options
context:
space:
mode:
authorLee Tickett <lee@tickett.net>2019-05-17 06:10:08 +0000
committerLin Jen-Shin <godfat@godfat.org>2019-05-17 06:10:08 +0000
commita4e9259d8a39c0f1777af025fd7255dafb5d0e44 (patch)
treedd28b060b855813271073c72894927c82fda1076 /lib/api
parentf7ebea045b6bb964072617efa5d4370f22badb7d (diff)
downloadgitlab-ce-a4e9259d8a39c0f1777af025fd7255dafb5d0e44.tar.gz
#46469 - Added ref querystring parameter to project search to allow searching on branches other than master
Diffstat (limited to 'lib/api')
-rw-r--r--lib/api/search.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/api/search.rb b/lib/api/search.rb
index 60095300ea1..1cab1a97186 100644
--- a/lib/api/search.rb
+++ b/lib/api/search.rb
@@ -112,12 +112,13 @@ module API
type: String,
desc: 'The scope of the search',
values: Helpers::SearchHelpers.project_search_scopes
+ optional :ref, type: String, desc: 'The name of a repository branch or tag. If not given, the default branch is used'
use :pagination
end
get ':id/(-/)search' do
check_users_search_allowed!
- present search(project_id: user_project.id), with: entity
+ present search({ project_id: user_project.id, repository_ref: params[:ref] }), with: entity
end
end
end