refactor: simplify worktree management by removing legacy API
- Remove legacy worktree API usage and related state - Add Manage Branches button in the Git header for quick access - Introduce worktree status utilities to derive root branch hints
This commit is contained in:
@@ -17,8 +17,6 @@ import type {
|
||||
GeneratedCommitMessage,
|
||||
GeneratedPullRequestDescription,
|
||||
GitWorktreeInfo,
|
||||
GitAddWorktreePayload,
|
||||
GitRemoveWorktreePayload,
|
||||
GitCommitResult,
|
||||
CreateGitCommitOptions,
|
||||
GitPushResult,
|
||||
@@ -112,30 +110,6 @@ export const createVSCodeGitAPI = (): GitAPI => ({
|
||||
return sendBridgeMessage<GitWorktreeInfo[]>('api:git/worktrees', { directory, method: 'GET' });
|
||||
},
|
||||
|
||||
addGitWorktree: async (directory: string, payload: GitAddWorktreePayload): Promise<{ success: boolean; path: string; branch: string }> => {
|
||||
return sendBridgeMessage<{ success: boolean; path: string; branch: string }>('api:git/worktrees', {
|
||||
directory,
|
||||
method: 'POST',
|
||||
path: payload.path,
|
||||
branch: payload.branch,
|
||||
createBranch: payload.createBranch,
|
||||
startPoint: payload.startPoint,
|
||||
});
|
||||
},
|
||||
|
||||
removeGitWorktree: async (directory: string, payload: GitRemoveWorktreePayload): Promise<{ success: boolean }> => {
|
||||
return sendBridgeMessage<{ success: boolean }>('api:git/worktrees', {
|
||||
directory,
|
||||
method: 'DELETE',
|
||||
path: payload.path,
|
||||
force: payload.force,
|
||||
});
|
||||
},
|
||||
|
||||
ensureOpenChamberIgnored: async (directory: string): Promise<void> => {
|
||||
await sendBridgeMessage('api:git/ignore-openchamber', { directory });
|
||||
},
|
||||
|
||||
createGitCommit: async (directory: string, message: string, options?: CreateGitCommitOptions): Promise<GitCommitResult> => {
|
||||
return sendBridgeMessage<GitCommitResult>('api:git/commit', {
|
||||
directory,
|
||||
|
||||
Reference in New Issue
Block a user