|
@@ -66,14 +66,22 @@ class GetSource extends Command
|
|
|
} catch (GitException $e) {
|
|
|
$output->writeln("<error>" . $e->getMessage() . "</error>");
|
|
|
}
|
|
|
+
|
|
|
+ $branches = $git->branch(array("all" => false, "remotes" => true));
|
|
|
+
|
|
|
$branch_from_options = $input->getOption("branch");
|
|
|
if (!empty($branch_from_options)) {
|
|
|
$git->checkout($branch_from_options);
|
|
|
$conf["branch"] = $branch_from_options;
|
|
|
- } else {
|
|
|
- $git->checkout($conf["branch"]);
|
|
|
+ } else if (strtolower($conf["branch"]) != "master"){
|
|
|
+ try {
|
|
|
+ $git->checkout->create($conf["branch"]);
|
|
|
+ } catch (GitException $e) {
|
|
|
+ $output->writeln($e->getTraceAsString());
|
|
|
+ die;
|
|
|
+ }
|
|
|
+ $git->merge("origin/" . $conf["branch"]);
|
|
|
}
|
|
|
- $branches = $git->branch(array("all" => false, "remotes" => true));
|
|
|
|
|
|
if (isset($branches["remotes/" . $input->getOption("remote-name") . "/" . $conf["branch"]])) {
|
|
|
$git->merge($input->getOption("remote-name") . "/" . $conf["branch"]);
|