1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 09:18:48 +02:00

Check for empty output from git ls-tree

Summary: Fixes T10155

Test Plan: View an empty repository in diffusion, check for the exception.
See T10155 for steps to reproduce

Reviewers: epriestley

Subscribers:
This commit is contained in:
Mukunda Modell 2016-09-08 21:04:58 -05:00
parent 05f5653091
commit c0bf08058b

View file

@ -105,7 +105,11 @@ final class DiffusionBrowseQueryConduitAPIMethod
$count = 0;
$results = array();
foreach (explode("\0", rtrim($stdout)) as $line) {
$lines = empty($stdout)
? array()
: explode("\0", rtrim($stdout));
foreach ($lines as $line) {
// NOTE: Limit to 5 components so we parse filenames with spaces in them
// correctly.
// NOTE: The output uses a mixture of tabs and one-or-more spaces to