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:
authorPaco Guzman <pacoguzmanp@gmail.com>2016-06-20 16:38:54 +0300
committerPaco Guzman <pacoguzmanp@gmail.com>2016-06-20 22:44:21 +0300
commit208b18c956b38103b98bc93a952dc1e8a200dead (patch)
tree518e0892089d6d3771097192be2487c446343bfa /app/models/user.rb
parent74f8f260982a9b9e1941ad803d53d229cc27c85f (diff)
Unify check branch name exist
Diffstat (limited to 'app/models/user.rb')
-rw-r--r--app/models/user.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index 2e458329cb9..876ccc69d8d 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -487,9 +487,8 @@ class User < ActiveRecord::Base
events.recent.find do |event|
project = Project.find_by_id(event.project_id)
next unless project
- repo = project.repository
- if repo.branch_names.include?(event.branch_name)
+ if project.repository.branch_exists?(event.branch_name)
merge_requests = MergeRequest.where("created_at >= ?", event.created_at).
where(source_project_id: project.id,
source_branch: event.branch_name)