public function countCommits()
    {
        if (null !== $this->revisions && count($this->revisions)) {
            $output = $this->repository->run('rev-list', array_merge(array('--count'), $this->revisions->getAsTextArray(), array('--'), $this->paths));
        } else {
            $output = $this->repository->run('rev-list', array_merge(array('--count', '--all', '--'), $this->paths));
        }

        return (int) $output;
    }