/** * @param $directory * * @throws \InvalidArgumentException * * @return $this */ public function setDirectory($directory) { if (!Git::isGitRepository($directory)) { throw new \InvalidArgumentException("Directory doesn't appear to be a git repository"); } $this->directory = realpath($directory); return $this; }