summaryrefslogtreecommitdiff
path: root/app/models/commit.rb
diff options
context:
space:
mode:
authorHanfei Shen <qqshfox@gmail.com>2015-03-02 15:15:01 +0800
committerHanfei Shen <qqshfox@gmail.com>2015-03-02 15:15:01 +0800
commita54b771f399a89c788455d2a1450034570ef6b40 (patch)
tree3a440bacd78bfe935493f076da33e5ff211e5676 /app/models/commit.rb
parent6c264f4fc4ab5cdb43855421bea51af98333935f (diff)
downloadgitlab-ci-a54b771f399a89c788455d2a1450034570ef6b40.tar.gz
Fix coverage for a commit having more than one build
Diffstat (limited to 'app/models/commit.rb')
-rw-r--r--app/models/commit.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb
index 4943d66..729b614 100644
--- a/app/models/commit.rb
+++ b/app/models/commit.rb
@@ -183,8 +183,8 @@ class Commit < ActiveRecord::Base
end
def coverage
- if project.coverage_enabled? && builds.size == 1
- builds.first.coverage
+ if project.coverage_enabled? && builds.size > 0
+ builds.last.coverage
end
end