diff --git a/src/PHPGit/Git.php b/src/PHPGit/Git.php index f952d6f..679b680 100644 --- a/src/PHPGit/Git.php +++ b/src/PHPGit/Git.php @@ -181,10 +181,13 @@ class Git /** @var string */ private $directory = '.'; + /** @var integer */ + private $timeout = 60; + /** * Initializes sub-commands */ - public function __construct() + public function __construct($timeout = 60) { $this->add = new Command\AddCommand($this); $this->archive = new Command\ArchiveCommand($this); @@ -212,6 +215,8 @@ public function __construct() $this->status = new Command\StatusCommand($this); $this->tag = new Command\TagCommand($this); $this->tree = new Command\TreeCommand($this); + + $this->timeout = $timeout; } /** @@ -283,7 +288,8 @@ public function getProcessBuilder() { return ProcessBuilder::create() ->setPrefix($this->bin) - ->setWorkingDirectory($this->directory); + ->setWorkingDirectory($this->directory) + ->setTimeout($this->timeout); } /** @@ -305,4 +311,4 @@ public function run(Process $process) return $process->getOutput(); } -} \ No newline at end of file +}