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
0d583e5e
Commit
0d583e5e
authored
6 years ago
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Creates ref_exists? method for Pipeline class
parent
fa875ba7
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
2 deletions
+6
-2
app/models/ci/pipeline.rb
app/models/ci/pipeline.rb
+4
-0
app/views/projects/pipelines/_info.html.haml
app/views/projects/pipelines/_info.html.haml
+1
-1
spec/features/projects/pipelines/pipeline_spec.rb
spec/features/projects/pipelines/pipeline_spec.rb
+1
-1
No files found.
app/models/ci/pipeline.rb
View file @
0d583e5e
...
@@ -268,6 +268,10 @@ module Ci
...
@@ -268,6 +268,10 @@ module Ci
stage
unless
stage
.
statuses_count
.
zero?
stage
unless
stage
.
statuses_count
.
zero?
end
end
def
ref_exists?
project
.
repository
.
ref_exists?
(
self
.
ref
)
end
##
##
# TODO We do not completely switch to persisted stages because of
# TODO We do not completely switch to persisted stages because of
# race conditions with setting statuses gitlab-ce#23257.
# race conditions with setting statuses gitlab-ce#23257.
...
...
This diff is collapsed.
Click to expand it.
app/views/projects/pipelines/_info.html.haml
View file @
0d583e5e
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
=
pluralize
@pipeline
.
total_size
,
"job"
=
pluralize
@pipeline
.
total_size
,
"job"
-
if
@pipeline
.
ref
-
if
@pipeline
.
ref
from
from
-
if
@p
roject
.
repository
.
branch_exists?
(
@pipeline
.
ref
)
-
if
@p
ipeline
.
ref_exists?
=
link_to
@pipeline
.
ref
,
project_ref_path
(
@project
,
@pipeline
.
ref
),
class:
"ref-name"
=
link_to
@pipeline
.
ref
,
project_ref_path
(
@project
,
@pipeline
.
ref
),
class:
"ref-name"
-
else
-
else
%span
.ref-name
%span
.ref-name
...
...
This diff is collapsed.
Click to expand it.
spec/features/projects/pipelines/pipeline_spec.rb
View file @
0d583e5e
...
@@ -244,7 +244,7 @@ describe 'Pipeline', :js do
...
@@ -244,7 +244,7 @@ describe 'Pipeline', :js do
context
'with deleted branch'
do
context
'with deleted branch'
do
before
do
before
do
DeleteBranchService
.
new
(
@project
,
@user
).
execute
(
pipeline
.
ref
)
allow
(
pipeline
).
to
receive
(
:ref_exists?
).
and_return
(
false
)
end
end
it
'does not render link to the pipeline ref'
do
it
'does not render link to the pipeline ref'
do
...
...
This diff is collapsed.
Click to expand it.
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