public function testRawDiff() { $commit = new Commit(self::$repository, 'fccd14eaa8d5f7654ce838becb6b47e34f4bcc43'); $this->assertEquals('4d0cbc9298c4d8c9877a84e42a5b8aac', md5($commit->getRawDiff())); $commit = new Commit(self::$repository, '5ff8ff94448ef3882daf4b9121b847d8540a065b'); $this->assertEmpty($commit->getRawDiff()); }
/** * Get last commits on the file. * * @param int $nbCommits Number of log entries to get * @return array Commit objects representing last modifications. */ public function log($nbCommits = 10) { $output = $this->repository->git('log -n %d %s -- %s', (int) $nbCommits, Commit::FORMAT, escapeshellarg($this->getRelativePathname())); return Commit::parse($this->repository, $output); }
/** * Return the result of `git log` formatted in a PHP array * * @param integer $nbCommits Limit of commits to get * @return array list of commits and their properties * */ public function log($nbCommits = 10) { $output = $this->git('log -n %d %s', $nbCommits, Commit::FORMAT); return Commit::parse($this, $output); }