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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
dbd01113
Commit
dbd01113
authored
Jul 05, 2017
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert unnecesarry changes
parent
46076f15
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
10 deletions
+17
-10
app/models/ci/build.rb
app/models/ci/build.rb
+5
-2
spec/models/ci/build_spec.rb
spec/models/ci/build_spec.rb
+11
-7
spec/support/matchers/access_matchers_for_controller.rb
spec/support/matchers/access_matchers_for_controller.rb
+1
-1
No files found.
app/models/ci/build.rb
View file @
dbd01113
...
...
@@ -176,9 +176,12 @@ module Ci
# * Lowercased
# * Anything not matching [a-z0-9-] is replaced with a -
# * Maximum length is 63 bytes
# * First/Last Character is not a hyphen
def
ref_slug
slugified
=
ref
.
to_s
.
downcase
slugified
.
gsub
(
/[^a-z0-9]/
,
'-'
)[
0
..
62
]
ref
.
to_s
.
downcase
.
gsub
(
/[^a-z0-9]/
,
'-'
)[
0
..
62
]
.
gsub
(
/(\A-+|-+\z)/
,
''
)
end
# Variables whose value does not depend on environment
...
...
spec/models/ci/build_spec.rb
View file @
dbd01113
...
...
@@ -998,13 +998,17 @@ describe Ci::Build, :models do
describe
'#ref_slug'
do
{
'master'
=>
'master'
,
'1-foo'
=>
'1-foo'
,
'fix/1-foo'
=>
'fix-1-foo'
,
'fix-1-foo'
=>
'fix-1-foo'
,
'a'
*
63
=>
'a'
*
63
,
'a'
*
64
=>
'a'
*
63
,
'FOO'
=>
'foo'
'master'
=>
'master'
,
'1-foo'
=>
'1-foo'
,
'fix/1-foo'
=>
'fix-1-foo'
,
'fix-1-foo'
=>
'fix-1-foo'
,
'a'
*
63
=>
'a'
*
63
,
'a'
*
64
=>
'a'
*
63
,
'FOO'
=>
'foo'
,
'-'
+
'a'
*
61
+
'-'
=>
'a'
*
61
,
'-'
+
'a'
*
62
+
'-'
=>
'a'
*
62
,
'-'
+
'a'
*
63
+
'-'
=>
'a'
*
62
,
'a'
*
62
+
' '
=>
'a'
*
62
}.
each
do
|
ref
,
slug
|
it
"transforms
#{
ref
}
to
#{
slug
}
"
do
build
.
ref
=
ref
...
...
spec/support/matchers/access_matchers_for_controller.rb
View file @
dbd01113
...
...
@@ -65,7 +65,7 @@ module AccessMatchersForController
end
matcher
:be_allowed_for
do
|
role
|
match
do
|
action
,
&
block
|
match
do
|
action
|
user
=
emulate_user
(
role
,
@membership
)
update_owner
(
@objects
,
user
)
action
.
call
...
...
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