diff options
Diffstat (limited to 'app/finders/context_commits_finder.rb')
-rw-r--r-- | app/finders/context_commits_finder.rb | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/app/finders/context_commits_finder.rb b/app/finders/context_commits_finder.rb index de89a556ee0..d623854ada4 100644 --- a/app/finders/context_commits_finder.rb +++ b/app/finders/context_commits_finder.rb @@ -11,9 +11,7 @@ class ContextCommitsFinder def execute commits = init_collection - commits = filter_existing_commits(commits) - - commits + filter_existing_commits(commits) end private @@ -21,19 +19,15 @@ class ContextCommitsFinder attr_reader :project, :merge_request, :search, :limit, :offset def init_collection - commits = - if search.present? - search_commits - else - project.repository.commits(merge_request.target_branch, { limit: limit, offset: offset }) - end - - commits + if search.present? + search_commits + else + project.repository.commits(merge_request.target_branch, { limit: limit, offset: offset }) + end end def filter_existing_commits(commits) commits.select! { |commit| already_included_ids.exclude?(commit.id) } - commits end |