mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-22 23:02:42 +01:00
Raise a better error for malformed git ls-tree
Summary: Ref T4159. See T4159 for discussion. Test Plan: Faked the error and generated a reasonable error message. Reviewers: hach-que, btrahan Reviewed By: btrahan CC: aran Maniphest Tasks: T4159 Differential Revision: https://secure.phabricator.com/D7744
This commit is contained in:
parent
5d27aeb240
commit
52462a46c0
1 changed files with 9 additions and 0 deletions
|
@ -100,6 +100,15 @@ final class ConduitAPI_diffusion_browsequery_Method
|
|||
|
||||
$results = array();
|
||||
foreach (explode("\0", rtrim($stdout)) as $line) {
|
||||
if (substr_count($line, ' ') < 4) {
|
||||
throw new Exception(
|
||||
pht(
|
||||
'Expected "<mode> <type> <hash> <size> <name>", for ls-tree of '.
|
||||
'"%s:%s", got: %s',
|
||||
$commit,
|
||||
$path,
|
||||
$line));
|
||||
}
|
||||
|
||||
// NOTE: Limit to 5 components so we parse filenames with spaces in them
|
||||
// correctly.
|
||||
|
|
Loading…
Reference in a new issue