Backend: an existing folder that cannot be listed is an error, not empty

Read as empty, a catalog/ or index/ folder would make an existing repository look new.
This commit is contained in:
2026-10-08 20:46:14 +02:00
parent ab3265e42c
commit fe1a289c2d
3 changed files with 16 additions and 2 deletions
+2 -1
View File
@@ -140,7 +140,8 @@ final class StorageBackend implements IBackend {
}
$dh = $this->storage->opendir($abs);
if ($dh === false) {
return [];
// An existing folder read as empty would look like a new repository.
throw new BackendException('Cannot list ' . $dir);
}
$cut = $this->base === '' ? 0 : strlen($this->base) + 1;
$result = [];