summaryrefslogtreecommitdiff
path: root/app/models/commit.rb
diff options
context:
space:
mode:
authorPaul Slaughter <pslaughter@gitlab.com>2018-10-03 04:08:00 -0500
committerPaul Slaughter <pslaughter@gitlab.com>2018-10-03 13:18:21 -0500
commitbecb86ea4e8032788b151caac004b2635b57c6a4 (patch)
treefbad0bec9e69fb82d6a72967ccae2812bbd25eb9 /app/models/commit.rb
parent5a286eb7a3a0c395d35c722ce6a067aca47473f2 (diff)
downloadgitlab-ce-becb86ea4e8032788b151caac004b2635b57c6a4.tar.gz
Add pipeline status to diffs/commit_item49329-mr-show-commit-details
**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)