Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
2bacfda2
Commit
2bacfda2
authored
Oct 18, 2019
by
Balasankar "Balu" C
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Truncate recommended branch name to a sane length
Signed-off-by:
Balasankar "Balu" C
<
balasankar@gitlab.com
>
parent
b1a088ec
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
1 deletion
+14
-1
app/models/issue.rb
app/models/issue.rb
+1
-1
changelogs/unreleased/27034-new-branch-length.yml
changelogs/unreleased/27034-new-branch-length.yml
+5
-0
spec/models/issue_spec.rb
spec/models/issue_spec.rb
+8
-0
No files found.
app/models/issue.rb
View file @
2bacfda2
...
...
@@ -206,7 +206,7 @@ class Issue < ApplicationRecord
if
self
.
confidential?
"
#{
iid
}
-confidential-issue"
else
"
#{
iid
}
-
#{
title
.
parameterize
}
"
"
#{
iid
}
-
#{
title
.
parameterize
}
"
[
0
,
99
]
end
end
...
...
changelogs/unreleased/27034-new-branch-length.yml
0 → 100644
View file @
2bacfda2
---
title
:
Truncate recommended branch name to a sane length
merge_request
:
18821
author
:
type
:
changed
spec/models/issue_spec.rb
View file @
2bacfda2
...
...
@@ -423,6 +423,14 @@ describe Issue do
issue
=
create
(
:issue
,
title:
'testing-issue'
,
confidential:
true
)
expect
(
issue
.
to_branch_name
).
to
match
/confidential-issue\z/
end
context
'issue title longer than 100 characters'
do
let
(
:issue
)
{
create
(
:issue
,
iid:
999
,
title:
'Lorem ipsum dolor sit amet consectetur adipiscing elit Mauris sit amet ipsum id lacus fringilla convallis'
)
}
it
"truncates title part of branch name to 100 characters"
do
expect
(
issue
.
to_branch_name
).
to
eq
(
"999-lorem-ipsum-dolor-sit-amet-consectetur-adipiscing-elit-mauris-sit-amet-ipsum-id-lacus-fringilla"
)
end
end
end
describe
'#can_be_worked_on?'
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment