diff options
| author | Daniel Weipert <git@mail.dweipert.de> | 2026-06-16 22:32:21 +0200 |
|---|---|---|
| committer | Daniel Weipert <git@mail.dweipert.de> | 2026-06-16 22:32:21 +0200 |
| commit | 4304eecf3f9d53941cdd31d4bf6ae7a5039fe7b2 (patch) | |
| tree | 55d59cdb1924d15e9fb39e9cf8f489040a20a91f | |
| parent | 226faf34b0ec4e70d87c8fd8fca43955d1e92dda (diff) | |
fix scandir on non-git project directories
| -rw-r--r-- | index.php | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -18,7 +18,12 @@ function find_projects(string $path, array $projects = []): array { $projects[] = $path; } else { - if (count(array_intersect(scandir($path), ["HEAD", "objects", "refs"])) == 3) { + $scan = @scandir($path); + if (! $scan) { + return $projects; + } + + if (count(array_intersect($scan, ["HEAD", "objects", "refs"])) == 3) { $projects[] = $path; } else { |
