Abstracting the pager and improving the pagination system

This commit is contained in:
Klaus Silveira
2012-05-23 20:58:38 -03:00
parent e453a74778
commit 9c4b5e9f35
4 changed files with 35 additions and 21 deletions

View File

@@ -222,9 +222,15 @@ class Repository
* @access public
* @return integer Total number of commits
*/
public function getTotalCommits()
public function getTotalCommits($file = null)
{
$commits = $this->getClient()->run($this, "rev-list --all --count");
$command = "rev-list --all --count";
if ($file) {
$command .= " $file";
}
$commits = $this->getClient()->run($this, $command);
return $commits;
}