diff --git a/src/Splitter/Adapter/SplitshLiteAdapter.php b/src/Splitter/Adapter/SplitshLiteAdapter.php
index c034b83..3febb2c 100644
--- a/src/Splitter/Adapter/SplitshLiteAdapter.php
+++ b/src/Splitter/Adapter/SplitshLiteAdapter.php
@@ -55,7 +55,5 @@ private function subtree(string $libraryPath, string $libraryBranch, bool $scrat
{
$opt = $scratch ? ['--scratch'] : [];
ProcessUtil::run(['splitsh-lite', '--prefix='.$libraryPath, '--target=heads/'.$libraryBranch, '--quiet', ...$opt]);
- ProcessUtil::run(['git', 'checkout', 'heads/'.$libraryBranch]);
- ProcessUtil::run(['git', 'switch', '-c', $libraryBranch]);
}
}
diff --git a/src/Splitter/Splitter.php b/src/Splitter/Splitter.php
index c3ead15..746d183 100644
--- a/src/Splitter/Splitter.php
+++ b/src/Splitter/Splitter.php
@@ -90,16 +90,14 @@ public function prepare(string $remote, string $branch, bool $fetch = true): voi
}
$this->io->write(sprintf('[%s] Create subtree working branch %s', $branch, $subTreeBranch), true, OutputInterface::VERBOSITY_VERBOSE);
- ProcessUtil::run(['git', 'checkout', '-B', $subTreeBranch, $remoteBranch]);
+ ProcessUtil::run(['git', 'branch', $subTreeBranch, $remoteBranch]);
}
public function terminate(string $remote, string $branch): void
{
- $remoteBranch = $remote.'/'.$branch;
$subTreeBranch = BranchUtil::getSubTreeBranchName($branch);
$this->io->write(sprintf('[%s] Clean subtree working branch %s', $branch, $subTreeBranch), true, OutputInterface::VERBOSITY_VERBOSE);
- ProcessUtil::run(['git', 'checkout', '-B', $branch, $remoteBranch], false);
ProcessUtil::run(['git', 'branch', '-D', $subTreeBranch], false);
}