summaryrefslogtreecommitdiff
path: root/app/models/commit.rb
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2016-11-21 22:19:16 +0800
committerLin Jen-Shin <godfat@godfat.org>2016-11-21 22:19:16 +0800
commit721f2d3788ae5e8374f357014bd9e20d62de0a81 (patch)
tree44c2f09930d5212e260d7b7fe1fc3ee023b37f65 /app/models/commit.rb
parentb20c7846ffc0c78d6b483184363b6ccc7c11326d (diff)
downloadgitlab-ce-721f2d3788ae5e8374f357014bd9e20d62de0a81.tar.gz
Still use compound pipeline status, but group by
ref and sha so that it would show latest pipeline if ref and sha are both specified, otherwise still the same as before.
Diffstat (limited to 'app/models/commit.rb')
-rw-r--r--app/models/commit.rb8
1 files changed, 1 insertions, 7 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb
index 2134ba2d75f..b588b93b158 100644
--- a/app/models/commit.rb
+++ b/app/models/commit.rb
@@ -234,13 +234,7 @@ class Commit
return @statuses[ref] if @statuses.key?(ref)
- latest_pipeline = if ref
- pipelines.latest_for(ref)
- else
- pipelines.latest
- end.first
-
- @statuses[ref] = latest_pipeline.try(:status)
+ @statuses[ref] = pipelines.latest_for(ref).status
end
def revert_branch_name