1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-24 06:20:56 +01:00

Mark diffusion browse result as empty directory when appropriate

Summary:
When selecting children of a directory, it is possible that none of its
children exist anymore even though the directory still exists. After fetching
the children but before returning them, we should check whether there are any,
and if there are no children, set the reason as empty directory.

Test Plan:
In sandbox, browsed in diffusion to a directory that exists but has no
files and saw that it has a useful message instead of a vague exception.

Reviewers: epriestley, tuomaspelkonen, jungejason

Reviewed By: tuomaspelkonen

CC: aran, tuomaspelkonen

Differential Revision: 846
This commit is contained in:
Nicholas Harper 2011-08-22 13:33:48 -07:00
parent fbef90c4c6
commit bd2b557b42

View file

@ -179,6 +179,10 @@ final class DiffusionSvnBrowseQuery extends DiffusionBrowseQuery {
$results[] = $result; $results[] = $result;
} }
if (empty($results)) {
$this->reason = self::REASON_IS_EMPTY;
}
return $results; return $results;
} }