mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 12:54:20 +01:00
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:
1 parent
98e8c90455
commit
0a2e337efc
8 files changed
+363
-108
No files matched your search
@@ -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),
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user