public function testGetCurrentParents() { $tmpDir = $this->getTempDir(); mkdir($tmpDir, 0777, true); $this->exec('git init', $tmpDir); file_put_contents($tmpDir . '/foo', 'foo'); $this->exec('git add . && git commit -m "adds foo"', $tmpDir); $introspector = new RepositoryIntrospector($tmpDir); $headRev = $introspector->getCurrentRevision(); file_put_contents($tmpDir . '/bar', 'bar'); $this->exec('git add . && git commit -m "adds bar"', $tmpDir); $this->assertEquals(array($headRev), $introspector->getCurrentParents()); }
private function parseParents(array $parents) { if (!empty($parents)) { return $parents; } $repoInspector = new RepositoryIntrospector(getcwd()); return $repoInspector->getCurrentParents(); }