/** * Generates an example page. */ public function printPage() { $output = t('Hello <strong>@value!</strong>', array('@value' => $this->demoService->getDemoValue())); // $parser = new Jsonp(); // ; // $repo = new Repo('/Users/nikolay/Sites/gittest');. $git = new Git(); $git->setRepository('/Users/nikolay/Sites/gittest'); kint($git->log()); return array('#markup' => $output); }
public function testCommit() { $git = new Git(); $git->init($this->directory); $git->setRepository($this->directory); $filesystem = new Filesystem(); $filesystem->dumpFile($this->directory . '/test.txt', ''); $git->add('test.txt'); $git->commit('Initial commit'); $logs = $git->log('test.txt'); $this->assertCount(1, $logs); }
public function testCreateTagFromCommit() { $filesystem = new Filesystem(); $git = new Git(); $git->init($this->directory); $git->setRepository($this->directory); $filesystem->dumpFile($this->directory . '/README.md', 'hello'); $git->add('.'); $git->commit('Initial commit'); $log = $git->log(null, null, array('limit' => 1)); $git->tag->create('v1.0.0', $log[0]['hash']); $this->assertCount(1, $git->tag()); }
public function testDetachedHeadStatus() { $filesystem = new Filesystem(); $git = new Git(); $git->init($this->directory); $git->setRepository($this->directory); $filesystem->dumpFile($this->directory . '/item1.txt', '1'); $git->add('item1.txt'); $git->commit('initial commit'); $logs = $git->log(); $hash = $logs[0]['hash']; $git->checkout($hash); $status = $git->status(); $this->assertEquals(null, $status['branch']); }