public function getCurrentBranch()
{
$branches = $this->executeGitCommand('branch');
foreach ($branches as $branch) {
if (strpos($branch, '* ') === 0 && !preg_match('/^\\*\\s\\(.*\\)$/', $branch)) {
return substr($branch, 2);
}
}
throw new \Liip\RMT\Exception('Not currently on any branch');
}