From: epriestley Date: Tue, 13 Mar 2012 00:04:51 +0000 (-0700) Subject: Don't show "not executable" for files with no coverage information X-Git-Tag: conduit-4~102 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=d8b510596f6d9b8e204eb9e37a572c66e5efab42;p=arcanist.git Don't show "not executable" for files with no coverage information Summary: We incorrectly merge array() into empty string, which is later interpreted as "this file is entirely not-executable". Instead, show no coverage information in the UI. Test Plan: Looked at a README diff with no coverage information, got no UI render. Reviewers: tuomaspelkonen, btrahan, zeeg Reviewed By: tuomaspelkonen CC: aran, epriestley Maniphest Tasks: T965 Differential Revision: https://secure.phabricator.com/D1863 --- diff --git a/src/unit/result/ArcanistUnitTestResult.php b/src/unit/result/ArcanistUnitTestResult.php index 2ba78665..ef8e8d79 100644 --- a/src/unit/result/ArcanistUnitTestResult.php +++ b/src/unit/result/ArcanistUnitTestResult.php @@ -89,6 +89,10 @@ final class ArcanistUnitTestResult { * @return string Cumulative coverage report. */ public static function mergeCoverage(array $coverage) { + if (empty($coverage)) { + return null; + } + $base = reset($coverage); foreach ($coverage as $more_coverage) { $len = min(strlen($base), strlen($more_coverage));