Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-09-30 18:08:09 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-09-30 18:08:09 +0300
commit538fff823de57d1ba5317961aa43091de9dc007f (patch)
treec741665b338cc0d51ce5f73f5671e5eee8e69349 /app/presenters/commit_presenter.rb
parent3692e9f8a23386c627942ca2a9edd8c00af7e904 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/presenters/commit_presenter.rb')
-rw-r--r--app/presenters/commit_presenter.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/presenters/commit_presenter.rb b/app/presenters/commit_presenter.rb
index fc9853733c1..f5b1e45c0e9 100644
--- a/app/presenters/commit_presenter.rb
+++ b/app/presenters/commit_presenter.rb
@@ -6,11 +6,15 @@ class CommitPresenter < Gitlab::View::Presenter::Delegated
presents :commit
def status_for(ref)
- can?(current_user, :read_commit_status, commit.project) && commit.status(ref)
+ return unless can?(current_user, :read_commit_status, commit.project)
+
+ commit.latest_pipeline(ref)&.detailed_status(current_user)
end
def any_pipelines?
- can?(current_user, :read_pipeline, commit.project) && commit.pipelines.any?
+ return false unless can?(current_user, :read_pipeline, commit.project)
+
+ commit.pipelines.any?
end
def web_url