mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-18 02:31:10 +01: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:
parent
05f5653091
commit
c0bf08058b
1 changed files with 5 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue