mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-20 16:00:20 +00:00
Make some assumptions about proc_open()
This commit is contained in:
parent
1b2d2a3fe1
commit
db9ba83001
@ -39,7 +39,7 @@ final class Git{
|
||||
* @param bool $dirty reference parameter, set to whether the repo has local changes
|
||||
*/
|
||||
public static function getRepositoryState(string $dir, bool &$dirty) : ?string{
|
||||
if(Process::execute("git -C \"$dir\" rev-parse HEAD", $out) === 0 && $out !== false && strlen($out = trim($out)) === 40){
|
||||
if(Process::execute("git -C \"$dir\" rev-parse HEAD", $out) === 0 && strlen($out = trim($out)) === 40){
|
||||
if(Process::execute("git -C \"$dir\" diff --quiet") === 1 || Process::execute("git -C \"$dir\" diff --cached --quiet") === 1){ //Locally-modified
|
||||
$dirty = true;
|
||||
}
|
||||
|
@ -174,8 +174,17 @@ final class Process{
|
||||
return -1;
|
||||
}
|
||||
|
||||
$stdout = stream_get_contents($pipes[1]);
|
||||
$stderr = stream_get_contents($pipes[2]);
|
||||
$out = stream_get_contents($pipes[1]);
|
||||
if($out === false){
|
||||
throw new AssumptionFailedError("Presume this can't happen for proc_open ... ???");
|
||||
}
|
||||
$stdout = $out;
|
||||
|
||||
$err = stream_get_contents($pipes[2]);
|
||||
if($err === false){
|
||||
throw new AssumptionFailedError("Presume this can't happen for proc_open ... ???");
|
||||
}
|
||||
$stderr = $err;
|
||||
|
||||
foreach($pipes as $p){
|
||||
fclose($p);
|
||||
|
Loading…
x
Reference in New Issue
Block a user