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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user