fix library to show errors and not throw when there is arrays involved

This commit is contained in:
Ulf Gebhardt 2023-10-27 21:53:14 +02:00
parent 0372a2f50e
commit b170d9d758
Signed by: ulfgebhardt
GPG Key ID: DA6B843E748679C9

View File

@ -189,8 +189,9 @@ class GitRepo {
$env = array_merge($_ENV, $this->envopts);
}
$cwd = $this->repo_path;
$env['argv'] = null;
$resource = proc_open($command, $descriptorspec, $pipes, $cwd, $env);
$stdout = stream_get_contents($pipes[1]);
$stderr = stream_get_contents($pipes[2]);
foreach ($pipes as $pipe) {
@ -198,7 +199,7 @@ class GitRepo {
}
$status = trim(proc_close($resource));
//if ($status) throw new \Exception($stderr);
if ($status) throw new \Exception($stderr);
return $stdout;
}