Commit 377b59da authored by Timothy Andrew's avatar Timothy Andrew

Sanitize branch names for confidential issues.

- When creating new branches for confidential issues,
  prefer a branch name like `issue-15` to
  `some-sensitive-issue-title-15`.
- The behaviour for non-confidential issues stays the same.
parent 0913204f
...@@ -151,8 +151,12 @@ class Issue < ActiveRecord::Base ...@@ -151,8 +151,12 @@ class Issue < ActiveRecord::Base
end end
def to_branch_name def to_branch_name
if self.confidential?
"issue-#{iid}"
else
"#{title.parameterize}-#{iid}" "#{title.parameterize}-#{iid}"
end end
end
def can_be_worked_on?(current_user) def can_be_worked_on?(current_user)
!self.closed? && !self.closed? &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment