From 05e0b6d014944d4826d34d71a72e86ece29034d8 Mon Sep 17 00:00:00 2001
From: Jared Szechy <jared.szechy@brilligent.com>
Date: Thu, 17 Dec 2015 09:59:14 -0500
Subject: [PATCH] Fix build coverage regex matching to allow captures.

Fixes #2644
---
 app/models/ci/build.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb
index 6d9cdb9529..a5ced9c826 100644
--- a/app/models/ci/build.rb
+++ b/app/models/ci/build.rb
@@ -170,7 +170,7 @@ module Ci
 
     def extract_coverage(text, regex)
       begin
-        matches = text.gsub(Regexp.new(regex)).to_a.last
+        matches = regex.match(text).to_a.last
         coverage = matches.gsub(/\d+(\.\d+)?/).first
 
         if coverage.present?
-- 
2.30.9