public function getCurrentBranch($dir = null, $mustRun = false)
    {
        $args = ['symbolic-ref', '--short', 'HEAD'];

        return $this->execute($args, $dir, $mustRun);
    }
public function getCurrentBranch($dir = null, $mustRun = false)
    {
        $args = ['symbolic-ref', '--short', 'HEAD'];

        return $this->execute($args, $dir, $mustRun);
    }
public function getCurrentBranch ( $ dir = null , $ mustRun = false ) { $ args = [ 'symbolic-ref' , '--short' , 'HEAD' ] ; return $ this -> execute ( $ args , $ dir , $ mustRun ) ; }
Get the current branch name.

@param string $dir
The path to a Git repository.
@param bool   $mustRun
Enable exceptions if the Git command fails.

@return string|false
Get the current branch name .