diff options
author | Timothy Andrew <mail@timothyandrew.net> | 2016-04-15 09:50:53 +0530 |
---|---|---|
committer | Timothy Andrew <mail@timothyandrew.net> | 2016-04-15 09:50:53 +0530 |
commit | 953bafff90f33d93d1b138501643a94beda11d53 (patch) | |
tree | b1d77a923b50cbac451a76e2f4ba4a64fe21904a /app/models/issue.rb | |
parent | f5ce601c2b052b18398d2207c64ce8828b628521 (diff) | |
parent | a1497ba39c69cf57f0446a705448bef2aafcd7f0 (diff) | |
download | gitlab-ce-953bafff90f33d93d1b138501643a94beda11d53.tar.gz |
Merge remote-tracking branch 'origin/master' into 14566-confidential-issue-branches
Diffstat (limited to 'app/models/issue.rb')
-rw-r--r-- | app/models/issue.rb | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb index 252545d1147..530d2107596 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -105,11 +105,10 @@ class Issue < ActiveRecord::Base end # All branches containing the current issue's ID, except for - # those with a merge request open (that the current user can see) - # referencing the current issue. + # those with a merge request open referencing the current issue. def related_branches(current_user) branches_with_iid = project.repository.branch_names.select do |branch| - branch.end_with?("-#{iid}") + branch =~ /\A#{iid}-(?!\d+-stable)/i end branches_with_merge_request = self.referenced_merge_requests(current_user).map(&:source_branch) @@ -161,7 +160,7 @@ class Issue < ActiveRecord::Base if self.confidential? "issue-#{iid}" else - "#{title.parameterize}-#{iid}" + "#{iid}-#{title.parameterize}" end end |