public function getSize()
{
$process = ProcessBuilder::create(array('du', '-skc', $this->gitDir))->getProcess();
$process->run();
if (!preg_match('/(\\d+)\\s+total$/', trim($process->getOutput()), $vars)) {
$message = sprintf("Unable to parse process output\ncommand: %s\noutput: %s", $process->getCommandLine(), $process->getOutput());
if (null !== $this->logger) {
$this->logger->error($message);
}
if (true === $this->debug) {
throw new RuntimeException('unable to parse repository size output');
}
return;
}
return $vars[1];
}