for (int i = 0; i < branches.length(); i++)
{
String branch = branches.get(i);
final String branchLabel = branch.replaceFirst("^remotes/", "");
final String branchValue = branch.replaceFirst(" ->.*", "");
rootMenu.addItem(new MenuItem(branchLabel,
new SwitchBranchCommand(branchLabel,
branchValue)));
}
}