1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-12-26 23:40:56 +01:00

Ignore non-plaintext changes in cover

Test Plan:
Run ##arc lint## after changing a binary file
"Warning:  Invalid argument supplied for foreach() in
src/workflow/cover/ArcanistCoverWorkflow.php on line 88" should not be displayed

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, epriestley

Differential Revision: https://secure.phabricator.com/D1314
This commit is contained in:
vrana 2012-01-04 15:22:17 -08:00
parent 9cdaa6dc7a
commit 085aa6093b

View file

@ -1,7 +1,7 @@
<?php
/*
* Copyright 2011 Facebook, Inc.
* Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -75,15 +75,13 @@ EOTEXT
"You're covered, you didn't change anything.");
}
$changed = array();
foreach ($paths as $path) {
$changed[$path] = $this->getChangedLines($path, 'cover');
}
$covers = array();
foreach ($paths as $path) {
$lines = $this->getChangedLines($path, 'cover');
if (!$lines) {
continue;
}
$blame = $repository_api->getBlame($path);
$lines = $changed[$path];
foreach ($lines as $line) {
list($author, $revision) = idx($blame, $line, array(null, null));
if (!$author) {