public function commit($commitMsg, array $file = null, $author = null, array $extraArgs = array())
{
$author = $author ?: $this->getAuthor();
$args = array('--message' => $commitMsg);
if ($author !== null) {
$args['--author'] = $author;
}
foreach ($extraArgs as $value) {
$args[] = $value;
}
if ($file !== null) {
$args[] = '--';
$args = array_merge($args, $this->resolveLocalPath($file));
}
/** @var $result CallResult */
$result = $this->getGit()->{'commit'}($this->getRepositoryPath(), $args);
$result->assertSuccess(sprintf('Cannot commit to "%s"', $this->getRepositoryPath()));
}