public function __construct(Repository $repository) { $this->repository = $repository; if ($this->repository->isBare()) { throw new LogicException('Can\'t create a working copy on a bare repository'); } }