public function checkout($ref)
    {
        $this->clearAll();

        $what = $ref;
        if ($ref instanceof Branch) {
            $what = $ref->getName();
        } elseif ($ref instanceof TreeishInterface) {
            $what = $ref->getSha();
        }

        $this->addCommandName(self::GIT_CHECKOUT);
        $this->addCommandArgument('-q');
        $this->addCommandSubject($what);

        return $this->getCommand();
    }
public function checkout($ref)
    {
        $this->clearAll();

        $what = $ref;
        if ($ref instanceof Branch) {
            $what = $ref->getName();
        } elseif ($ref instanceof TreeishInterface) {
            $what = $ref->getSha();
        }

        $this->addCommandName(self::GIT_CHECKOUT);
        $this->addCommandArgument('-q');
        $this->addCommandSubject($what);

        return $this->getCommand();
    }
public function checkout ( $ ref ) { $ this -> clearAll ( ) ; $ what = $ ref ; if ( $ ref instanceof Branch ) { $ what = $ ref -> getName ( ) ; } elseif ( $ ref instanceof TreeishInterface ) { $ what = $ ref -> getSha ( ) ; } $ this -> addCommandName ( self :: GIT_CHECKOUT ) ; $ this -> addCommandArgument ( '-q' ) ; $ this -> addCommandSubject ( $ what ) ; return $ this -> getCommand ( ) ; }
Checkout a treeish reference

@param string|Branch $ref the reference to checkout

@throws \RuntimeException
@return string
Checkout a treeish reference