X-Git-Url: https://git.cweiske.de/phorkie.git/blobdiff_plain/d63a7b14a6e1140fe5aa0610b1490f69b3494623..ba158e3ed03dec10e6654b0b0dd3710504bdf04d:/src/phorkie/Repository/ConnectionInfo.php diff --git a/src/phorkie/Repository/ConnectionInfo.php b/src/phorkie/Repository/ConnectionInfo.php new file mode 100644 index 0000000..3815856 --- /dev/null +++ b/src/phorkie/Repository/ConnectionInfo.php @@ -0,0 +1,42 @@ +repo = $repo; + $this->arConfig = parse_ini_file($this->repo->gitDir . '/config', true); + } + + public function isFork() + { + return $this->getOrigin() !== null; + } + + + public function getOrigin() + { + return $this->getRemote('origin'); + } + + /** + * @return Repository_Remote|null NULL if the remote does not exist, array + * with repository information otherwise + */ + public function getRemote($name) + { + if (!isset($this->arConfig['remote ' . $name])) { + return null; + } + return new Repository_Remote($name, $this->arConfig['remote ' . $name]); + } + +} + + +?>