summaryrefslogtreecommitdiff
path: root/app/models/issue.rb
diff options
context:
space:
mode:
authorZeger-Jan van de Weg <zegerjan@gitlab.com>2016-04-13 21:20:03 +0200
committerZeger-Jan van de Weg <zegerjan@gitlab.com>2016-04-14 14:49:45 +0200
commit0385cd5a585572be4d3b72797c14cad23efc48f5 (patch)
tree3f3f3e7d422b0b0a27e2042d7c8c0929af75cbe4 /app/models/issue.rb
parentc0678f2d281242601560e2646cab1aa8a349c4bb (diff)
downloadgitlab-ce-0385cd5a585572be4d3b72797c14cad23efc48f5.tar.gz
Start with iid on branch creation
Diffstat (limited to 'app/models/issue.rb')
-rw-r--r--app/models/issue.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb
index e064b0f8b95..3f188e04770 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -106,7 +106,7 @@ class Issue < ActiveRecord::Base
def related_branches
project.repository.branch_names.select do |branch|
- branch.end_with?("-#{iid}")
+ branch =~ /\A#{iid}-(?!\d+-stable)/i
end
end
@@ -151,7 +151,7 @@ class Issue < ActiveRecord::Base
end
def to_branch_name
- "#{title.parameterize}-#{iid}"
+ "#{iid}-#{title.parameterize}"
end
def can_be_worked_on?(current_user)