$current_branch = str_replace(array("\r", "\n"), array("", ""), $this->gitcmd("rev-parse", "--abbrev-ref", "HEAD"));
if($current_branch != $branch)
$this->gitcmd("checkout", $branch);
$current_branch = str_replace(array("\r", "\n"), array("", ""), $this->gitcmd("rev-parse", "--abbrev-ref", "HEAD"));
if($current_branch != $branch)
$this->gitcmd("checkout", $branch);