Commit 72111205 authored by mickadoo's avatar mickadoo

68: Remove public method checkoutBranch, embed code inside checkout method

parent 6f706f14
......@@ -18,15 +18,6 @@ class GitTools {
return $currentBranch;
}
/**
* @param $repoPath
* @param $branch
*/
public function checkoutBranch($repoPath, $branch) {
$gitCheckoutBranch = new Process("git checkout {$branch}", $repoPath);
$gitCheckoutBranch->run();
}
/**
* @param string $repoPath
*/
......@@ -73,7 +64,14 @@ class GitTools {
throw new \Exception($err);
}
}
$this->checkoutBranch($repoPath, $branch);
$process = new Process("git checkout {$branch}", $repoPath);
$process->run();
if (!$process->isSuccessful()) {
$err = "Unable to run 'git checkout'\n" . $process->getErrorOutput();
throw new \Exception($err);
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment