TQ\Svn\Repository\Repository::commit PHP Method

commit() public method

Commits the currently staged changes into the repository
public commit ( string $commitMsg, array $file = null, string | null $author = null, array $extraArgs = [] )
$commitMsg string The commit message
$file array Restrict commit to the given files or NULL to commit all staged changes
$author string | null The author
$extraArgs array Allow the user to pass extra args eg array('-i')
    public function commit($commitMsg, array $file = null, $author = null, array $extraArgs = array())
    {
        $author = $author ?: $this->getAuthor();
        $args = array('--message' => $commitMsg);
        if ($author !== null) {
            $args['--username'] = $author;
        }
        if ($file !== null) {
            $args[] = '--';
            $args = array_merge($args, $this->resolveLocalGlobPath($file));
        }
        /** @var $result CallResult */
        $result = $this->getSvn()->{'commit'}($this->getRepositoryPath(), $args);
        $result->assertSuccess(sprintf('Cannot commit to "%s"', $this->getRepositoryPath()));
    }