diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-11-03 10:16:09 +0100 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-11-03 10:16:09 +0100 |
commit | 28f6fba97cb9753c43d109ef4f43439413d4eb69 (patch) | |
tree | b696cda0aa6614f14ffd311030e995611b272f5e /lib | |
parent | 810c91fe35db6a83c9c517e03d07dc1795922646 (diff) | |
download | gitlab-ce-28f6fba97cb9753c43d109ef4f43439413d4eb69.tar.gz |
Fix commits search for empty repository
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/project_search_results.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/gitlab/project_search_results.rb b/lib/gitlab/project_search_results.rb index c873ef3771e..70de6a74e76 100644 --- a/lib/gitlab/project_search_results.rb +++ b/lib/gitlab/project_search_results.rb @@ -77,7 +77,11 @@ module Gitlab end def commits - project.repository.find_commits_by_message(query) + if project.empty_repo? || query.blank? + [] + else + project.repository.find_commits_by_message(query).compact + end end def limit_project_ids |