Skip to content

Commit

Permalink
Skip deleted files when filtering for git-modified
Browse files Browse the repository at this point in the history
Deleted files cause realpath($path) to return false. When this value
enters the while loop, it will run indefinitely as the condition will
never be matched.
  • Loading branch information
lmanzke committed Jan 29, 2019
1 parent 8c94cf9 commit c112065
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Filters/GitModified.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ protected function getWhitelist()

foreach ($output as $path) {
$path = Util\Common::realpath($path);

if ($path === false) {
continue;
}

do {
$modified[$path] = true;
$path = dirname($path);
Expand Down

0 comments on commit c112065

Please sign in to comment.