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
@@ -1366,6 +1366,7 @@ pub async fn add_git_worktree(
path_str: String,
branch: String,
create_branch: Option<bool>,
start_point: Option<String>,
state: State<'_, DesktopRuntime>,
) -> Result<(), String> {
let root = validate_git_path(&directory, state.settings())
@@ -1381,6 +1382,11 @@ pub async fn add_git_worktree(
if !create_branch.unwrap_or(false) {
args.push(&branch);
} else if let Some(start_point) = start_point.as_deref() {
let start_point = start_point.trim();
if !start_point.is_empty() {
args.push(start_point);
}
}
run_git(&args, &root).await.map_err(|e| e.to_string())?;