Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/finders/repositories/branch_names_finder.rb')
-rw-r--r--app/finders/repositories/branch_names_finder.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/app/finders/repositories/branch_names_finder.rb b/app/finders/repositories/branch_names_finder.rb
new file mode 100644
index 00000000000..5bb67425aa5
--- /dev/null
+++ b/app/finders/repositories/branch_names_finder.rb
@@ -0,0 +1,24 @@
+# frozen_string_literal: true
+
+module Repositories
+ class BranchNamesFinder
+ attr_reader :repository, :params
+
+ def initialize(repository, params = {})
+ @repository = repository
+ @params = params
+ end
+
+ def execute
+ return unless search
+
+ repository.search_branch_names(search)
+ end
+
+ private
+
+ def search
+ @params[:search].presence
+ end
+ end
+end