summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-04-14 13:41:30 +0000
committerRémy Coutable <remy@rymai.me>2016-04-14 13:41:30 +0000
commit64776ab2b4ef40519e75eb73ae946d2c1f774aa6 (patch)
tree8f6e32894fd46baf52ec131bb6246269263630bd /app/models
parente1acd361af01b429cdbb4aaed4431b01d9ab95ab (diff)
parent0385cd5a585572be4d3b72797c14cad23efc48f5 (diff)
downloadgitlab-ce-64776ab2b4ef40519e75eb73ae946d2c1f774aa6.tar.gz
Merge branch 'start-with-iid-on-new-branch' into 'master'
Start with iid on branch creation After the discussion it in #3886 it was decided the iid should be in the beginning of the branch name. See merge request !3708
Diffstat (limited to 'app/models')
-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)