feat(worktree): add start point option for new branch creation

Allow selecting a base branch when creating new worktree branches
Add dropdown to choose start point from existing branches
Extend worktree creation flow to support custom branch origins
This commit is contained in:
Bohdan Triapitsyn
2026-01-01 13:39:55 +02:00
parent 39b9f985ce
commit 5a71e050a5
8 changed files with 326 additions and 48 deletions
+3
View File
@@ -830,6 +830,7 @@ export async function addWorktree(directory, worktreePath, branch, options = {})
try {
const args = ['worktree', 'add'];
const startPoint = typeof options.startPoint === 'string' ? options.startPoint.trim() : '';
if (options.createBranch) {
args.push('-b', branch);
@@ -839,6 +840,8 @@ export async function addWorktree(directory, worktreePath, branch, options = {})
if (!options.createBranch) {
args.push(branch);
} else if (startPoint) {
args.push(startPoint);
}
await git.raw(args);