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.
This commit is contained in:
Timothy Andrew 2016-04-12 09:59:01 +05:30
parent 0913204f9b
commit 377b59da30
1 changed files with 5 additions and 1 deletions

View File

@ -151,7 +151,11 @@ class Issue < ActiveRecord::Base
end
def to_branch_name
"#{title.parameterize}-#{iid}"
if self.confidential?
"issue-#{iid}"
else
"#{title.parameterize}-#{iid}"
end
end
def can_be_worked_on?(current_user)