diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2016-10-20 13:43:33 +0300 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2016-10-20 13:43:33 +0300 |
commit | 6f875903a0f2f49ccf8bd59f6b9dfc2a658959c7 (patch) | |
tree | 85567015c56382636f2ecf3f01052c07b22cb2cc /lib | |
parent | ba28a64ef93f44e45e6ec04a15f6170061f309e1 (diff) | |
parent | fd2c3a3da0302a474d7c1adbd409aedea2a41053 (diff) |
Merge branch 'refactoring_find_commits_method' into 'master'
Refactoring find_commits method
It's possible that `find_commits_by_message` return nil in array which is not OK. We have different checks outside of this method. This MR places all checks inside the method.
See merge request !7000
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/project_search_results.rb | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/lib/gitlab/project_search_results.rb b/lib/gitlab/project_search_results.rb index 5b9cfaeb2f8..24733435a5a 100644 --- a/lib/gitlab/project_search_results.rb +++ b/lib/gitlab/project_search_results.rb @@ -73,11 +73,7 @@ module Gitlab end def commits - if project.empty_repo? || query.blank? - [] - else - project.repository.find_commits_by_message(query).compact - end + project.repository.find_commits_by_message(query) end def project_ids_relation |