public function setUpstream($upstream, $branch = null, $dir = null, $mustRun = false)
    {
        $args = ['branch'];
        if ($upstream !== false) {
            $args[] = '--set-upstream-to=' . $upstream;
        } else {
            $args[] = '--unset-upstream';
        }
        if ($branch !== null) {
            $args[] = $branch;
        }

        return (bool) $this->execute($args, $dir, $mustRun);
    }
public function setUpstream($upstream, $branch = null, $dir = null, $mustRun = false)
    {
        $args = ['branch'];
        if ($upstream !== false) {
            $args[] = '--set-upstream-to=' . $upstream;
        } else {
            $args[] = '--unset-upstream';
        }
        if ($branch !== null) {
            $args[] = $branch;
        }

        return (bool) $this->execute($args, $dir, $mustRun);
    }
public function setUpstream ( $ upstream , $ branch = null , $ dir = null , $ mustRun = false ) { $ args = [ 'branch' ] ; if ( $ upstream !== false ) { $ args [ ] = '--set-upstream-to=' . $ upstream ; } else { $ args [ ] = '--unset-upstream' ; } if ( $ branch !== null ) { $ args [ ] = $ branch ; } return ( bool ) $ this -> execute ( $ args , $ dir , $ mustRun ) ; }
Set the upstream for the current branch.

@param string|false $upstream
The upstream name, or false to unset the upstream.
@param string|null  $branch
The branch to act on (defaults to the current branch).
@param string|null  $dir
The path to a Git repository.
@param bool         $mustRun
Enable exceptions if the Git command fails.

@return bool
Set the upstream for the current branch .