Pantheon\Terminus\Models\Environment::commitChanges PHP Метод

commitChanges() публичный Метод

Commits changes to code
public commitChanges ( string $commit = null ) : array
$commit string Should be the commit message to use if committing on server changes
Результат array Response data
    public function commitChanges($commit = null)
    {
        // @TODO: Remove passthru from this function to make it testable.
        // One idea might be to move this discovery to Config (which can then be mocked in tests).
        ob_start();
        passthru('git config user.email');
        $git_email = ob_get_clean();
        ob_start();
        passthru('git config user.name');
        $git_user = ob_get_clean();
        $params = ['message' => $commit, 'committer_name' => $git_user, 'committer_email' => $git_email];
        $workflow = $this->getWorkflows()->create('commit_and_push_on_server_changes', compact('params'));
        return $workflow;
    }