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:
authorPaul Slaughter <pslaughter@gitlab.com>2018-10-03 12:08:00 +0300
committerPaul Slaughter <pslaughter@gitlab.com>2018-10-03 21:18:21 +0300
commitbecb86ea4e8032788b151caac004b2635b57c6a4 (patch)
treefbad0bec9e69fb82d6a72967ccae2812bbd25eb9 /app/models/commit.rb
parent5a286eb7a3a0c395d35c722ce6a067aca47473f2 (diff)
Add pipeline status to diffs/commit_item
**Notes:** - Also exposes commit.pipeline_status_path in diffs.json
Diffstat (limited to 'app/models/commit.rb')
-rw-r--r--app/models/commit.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb
index 49c36ad9d3f..a61ed03cf35 100644
--- a/app/models/commit.rb
+++ b/app/models/commit.rb
@@ -319,7 +319,11 @@ class Commit
def status(ref = nil)
return @statuses[ref] if @statuses.key?(ref)
- @statuses[ref] = project.pipelines.latest_status_per_commit(id, ref)[id]
+ @statuses[ref] = status_for_project(ref, project)
+ end
+
+ def status_for_project(ref, pipeline_project)
+ pipeline_project.pipelines.latest_status_per_commit(id, ref)[id]
end
def set_status_for_ref(ref, status)