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
Boxiang Sun
gitlab-ce
Commits
09d8c77a
Commit
09d8c77a
authored
Jan 16, 2019
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prevent checking protected_ref? for ambiguous refs
parent
dedaec13
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
lib/gitlab/ci/pipeline/chain/command.rb
lib/gitlab/ci/pipeline/chain/command.rb
+2
-0
spec/lib/gitlab/ci/pipeline/chain/command_spec.rb
spec/lib/gitlab/ci/pipeline/chain/command_spec.rb
+11
-0
No files found.
lib/gitlab/ci/pipeline/chain/command.rb
View file @
09d8c77a
...
@@ -53,6 +53,8 @@ module Gitlab
...
@@ -53,6 +53,8 @@ module Gitlab
end
end
def
protected_ref?
def
protected_ref?
return
if
ambiguous_ref?
strong_memoize
(
:protected_ref
)
do
strong_memoize
(
:protected_ref
)
do
project
.
protected_for?
(
origin_ref
)
project
.
protected_for?
(
origin_ref
)
end
end
...
...
spec/lib/gitlab/ci/pipeline/chain/command_spec.rb
View file @
09d8c77a
...
@@ -181,6 +181,17 @@ describe Gitlab::Ci::Pipeline::Chain::Command do
...
@@ -181,6 +181,17 @@ describe Gitlab::Ci::Pipeline::Chain::Command do
it
{
is_expected
.
to
eq
(
false
)
}
it
{
is_expected
.
to
eq
(
false
)
}
end
end
context
'when ref is ambiguous'
do
before
do
project
.
repository
.
add_tag
(
project
.
creator
,
'ref'
,
'master'
)
project
.
repository
.
add_branch
(
project
.
creator
,
'ref'
,
'master'
)
end
it
'does not raise an error'
do
expect
{
subject
}.
not_to
raise_error
end
end
end
end
describe
'#ambiguous_ref'
do
describe
'#ambiguous_ref'
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