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/context_commits_finder.rb')
-rw-r--r--app/finders/context_commits_finder.rb11
1 files changed, 7 insertions, 4 deletions
diff --git a/app/finders/context_commits_finder.rb b/app/finders/context_commits_finder.rb
index d623854ada4..4a45817cc61 100644
--- a/app/finders/context_commits_finder.rb
+++ b/app/finders/context_commits_finder.rb
@@ -5,8 +5,10 @@ class ContextCommitsFinder
@project = project
@merge_request = merge_request
@search = params[:search]
+ @author = params[:author]
+ @committed_before = params[:committed_before]
+ @committed_after = params[:committed_after]
@limit = (params[:limit] || 40).to_i
- @offset = (params[:offset] || 0).to_i
end
def execute
@@ -16,13 +18,13 @@ class ContextCommitsFinder
private
- attr_reader :project, :merge_request, :search, :limit, :offset
+ attr_reader :project, :merge_request, :search, :author, :committed_before, :committed_after, :limit
def init_collection
if search.present?
search_commits
else
- project.repository.commits(merge_request.target_branch, { limit: limit, offset: offset })
+ project.repository.commits(merge_request.target_branch, { limit: limit })
end
end
@@ -41,7 +43,8 @@ class ContextCommitsFinder
commits = [commit_by_sha] if commit_by_sha
end
else
- commits = project.repository.find_commits_by_message(search, merge_request.target_branch, nil, 20)
+ commits = project.repository.list_commits_by(search, merge_request.target_branch,
+ author: author, before: committed_before, after: committed_after, limit: limit)
end
commits