public function getCurrentBranchName() {
		try {
			$branch = $this->extractFromCommand('git branch -a', function ($value) {
				if(isset($value[0]) && $value[0] === '*') {
					return trim(substr($value, 1));
				}
				
				return false;
			});
			if(is_array($branch)) {
				return $branch[0];
			}
		} catch(ShellException $e) {
		}
		throw new ShellException('Getting current branch name failed.');
	}
public function getCurrentBranchName() {
		try {
			$branch = $this->extractFromCommand('git branch -a', function ($value) {
				if(isset($value[0]) && $value[0] === '*') {
					return trim(substr($value, 1));
				}
				
				return false;
			});
			if(is_array($branch)) {
				return $branch[0];
			}
		} catch(ShellException $e) {
		}
		throw new ShellException('Getting current branch name failed.');
	}
public function getCurrentBranchName ( ) { try { $ branch = $ this -> extractFromCommand ( 'git branch -a' , function ( $ value ) { if ( isset ( $ value [ 0 ] ) && $ value [ 0 ] === '*' ) { return trim ( substr ( $ value , 1 ) ) ; } return false ; } ) ; if ( is_array ( $ branch ) ) { return $ branch [ 0 ] ; } } catch ( ShellException $ e ) { } throw new ShellException ( 'Getting current branch name failed.' ) ; }
Gets name of current branch
`git branch` + magic

@return string
@throws ShellException
Gets name of current branch git branch + magic