Skip to content

Commit aba6c3c

Browse files
Do not checkout on the subtree branch before split
1 parent 11d693c commit aba6c3c

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

src/Splitter/Adapter/SplitshLiteAdapter.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,5 @@ private function subtree(string $libraryPath, string $libraryBranch, bool $scrat
5555
{
5656
$opt = $scratch ? ['--scratch'] : [];
5757
ProcessUtil::run(['splitsh-lite', '--prefix='.$libraryPath, '--target=heads/'.$libraryBranch, '--quiet', ...$opt]);
58-
ProcessUtil::run(['git', 'checkout', 'heads/'.$libraryBranch]);
59-
ProcessUtil::run(['git', 'switch', '-c', $libraryBranch]);
6058
}
6159
}

src/Splitter/Splitter.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,16 +90,14 @@ public function prepare(string $remote, string $branch, bool $fetch = true): voi
9090
}
9191

9292
$this->io->write(sprintf('[<info>%s</info>] Create subtree working branch <comment>%s</comment>', $branch, $subTreeBranch), true, OutputInterface::VERBOSITY_VERBOSE);
93-
ProcessUtil::run(['git', 'checkout', '-B', $subTreeBranch, $remoteBranch]);
93+
ProcessUtil::run(['git', 'branch', $subTreeBranch, $remoteBranch]);
9494
}
9595

9696
public function terminate(string $remote, string $branch): void
9797
{
98-
$remoteBranch = $remote.'/'.$branch;
9998
$subTreeBranch = BranchUtil::getSubTreeBranchName($branch);
10099

101100
$this->io->write(sprintf('[<info>%s</info>] Clean subtree working branch <comment>%s</comment>', $branch, $subTreeBranch), true, OutputInterface::VERBOSITY_VERBOSE);
102-
ProcessUtil::run(['git', 'checkout', '-B', $branch, $remoteBranch], false);
103101
ProcessUtil::run(['git', 'branch', '-D', $subTreeBranch], false);
104102
}
105103

0 commit comments

Comments
 (0)