summaryrefslogtreecommitdiff
path: root/app/models/issue.rb
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-03-20 11:01:08 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-03-20 11:01:08 +0100
commit797af06491b8e9bbc7eb75466b0cf3fabd0f14d8 (patch)
treea9aee22a17942adf5722ae1057536581896a1e72 /app/models/issue.rb
parent6eb31056346ed07db4f66e4ba2369ff9779230c5 (diff)
parent01fe50a72513a88f2168c8c0a649661b1382a42b (diff)
downloadgitlab-ce-797af06491b8e9bbc7eb75466b0cf3fabd0f14d8.tar.gz
Merge branch 'master' into feature/issue-move
* master: Fix bug where wrong commit ID was being used in a merge request diff to show old image Remove CHANGELOG item that was added during merge resolution Improve the "easy WIP & un-WIP from link" feature Fix specs \#to_branch_name now uses the iid as postfix Add label description in tooltip to labels in issue index and sidebar Easily (un)mark merge request as WIP using link Use specialized system notes when MR is (un)marked as WIP another attempt to fix oauth issue attempting to fix omniauth problem Conflicts: app/assets/javascripts/issuable_form.js.coffee
Diffstat (limited to 'app/models/issue.rb')
-rw-r--r--app/models/issue.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb
index 6a9253c3385..35e08fa915b 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -109,9 +109,8 @@ class Issue < ActiveRecord::Base
def related_branches
return [] if self.project.empty_repo?
- self.project.repository.branch_names.select do |branch|
- branch =~ /\A#{iid}-(?!\d+-stable)/i
- end
+
+ self.project.repository.branch_names.select { |branch| branch.end_with?("-#{iid}") }
end
# Reset issue events cache
@@ -154,7 +153,7 @@ class Issue < ActiveRecord::Base
end
def to_branch_name
- "#{iid}-#{title.parameterize}"
+ "#{title.parameterize}-#{iid}"
end
def can_be_worked_on?(current_user)