/** * Creates a new repository on the specified path * * @param string $path Path where the new repository will be created * @return Repository Instance of Repository */ public function createRepository($path) { if (file_exists($path . '/.git/HEAD') && !file_exists($path . '/HEAD')) { throw new \RuntimeException('A GIT repository already exists at ' . $path); } $repository = new Repository($path, $this); return $repository->create(); }
/** * @expectedException Git\Exception\GitRuntimeException */ public function testCreate() { Repository::create('/dev/null'); }