feat: add base branch support for worktree creation (#197)

- Add baseBranch parameter to cloneRepo and createWorktreeSafely
- Create CreateWorktreeDialog component for dedicated worktree creation
- Add Create Worktree action to RepoRowActions and RepoDetail page
- Update BranchesTab to use CreateWorktreeDialog
- Allow specifying base branch when creating worktrees
This commit is contained in:
Chris Scott authored and GitHub committed 2026-04-24 14:33:11 -04:00
1 parent 98e8c90455
commit 0a2e337efc
8 files changed
+363 -108

No files matched your search

+11 -8
View File
@@ -3,18 +3,21 @@ import { FetchError, fetchWrapper, fetchWrapperVoid, fetchWrapperBlob } from './
import { API_BASE_URL } from '@/config'
import type { DiscoverReposResponse } from '@opencode-manager/shared/types'
export async function createRepo(
repoUrl?: string,
localPath?: string,
branch?: string,
openCodeConfigName?: string,
useWorktree?: boolean,
export interface CreateRepoOptions {
repoUrl?: string
localPath?: string
branch?: string
openCodeConfigName?: string
useWorktree?: boolean
skipSSHVerification?: boolean
): Promise<Repo> {
baseBranch?: string
}
export async function createRepo(options: CreateRepoOptions = {}): Promise<Repo> {
return fetchWrapper(`${API_BASE_URL}/api/repos`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ repoUrl, localPath, branch, openCodeConfigName, useWorktree, skipSSHVerification }),
body: JSON.stringify(options),
})
}