Skip to content

Commit 926127f

Browse files
committed
Filter/GitStaged: skip deleted files
Applies the same fix as applied in 2393 to the `GitModified` filter to the new `GitStaged` filter. Props: lmanzke
1 parent 832222d commit 926127f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Filters/GitStaged.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ protected function getWhitelist()
4949

5050
foreach ($output as $path) {
5151
$path = Util\Common::realpath($path);
52+
if ($path === false) {
53+
// Skip deleted files.
54+
continue;
55+
}
56+
5257
do {
5358
$modified[$path] = true;
5459
$path = dirname($path);

0 commit comments

Comments
 (0)