mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-03-18 22:33:08 +00:00
feat: Fix new branch issues and address code review comments
This commit is contained in:
@@ -2291,11 +2291,18 @@ function createMockWorktreeAPI(): WorktreeAPI {
|
||||
};
|
||||
},
|
||||
|
||||
checkoutBranch: async (worktreePath: string, branchName: string, baseBranch?: string) => {
|
||||
checkoutBranch: async (
|
||||
worktreePath: string,
|
||||
branchName: string,
|
||||
baseBranch?: string,
|
||||
stashChanges?: boolean,
|
||||
_includeUntracked?: boolean
|
||||
) => {
|
||||
console.log('[Mock] Creating and checking out branch:', {
|
||||
worktreePath,
|
||||
branchName,
|
||||
baseBranch,
|
||||
stashChanges,
|
||||
});
|
||||
return {
|
||||
success: true,
|
||||
@@ -2303,6 +2310,22 @@ function createMockWorktreeAPI(): WorktreeAPI {
|
||||
previousBranch: 'main',
|
||||
newBranch: branchName,
|
||||
message: `Created and checked out branch '${branchName}'`,
|
||||
hasConflicts: false,
|
||||
stashedChanges: stashChanges ?? false,
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
checkChanges: async (worktreePath: string) => {
|
||||
console.log('[Mock] Checking for uncommitted changes:', worktreePath);
|
||||
return {
|
||||
success: true,
|
||||
result: {
|
||||
hasChanges: false,
|
||||
staged: [],
|
||||
unstaged: [],
|
||||
untracked: [],
|
||||
totalFiles: 0,
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
@@ -2139,8 +2139,22 @@ export class HttpApiClient implements ElectronAPI {
|
||||
this.post('/api/worktree/stage-files', { worktreePath, files, operation }),
|
||||
pull: (worktreePath: string, remote?: string, stashIfNeeded?: boolean) =>
|
||||
this.post('/api/worktree/pull', { worktreePath, remote, stashIfNeeded }),
|
||||
checkoutBranch: (worktreePath: string, branchName: string, baseBranch?: string) =>
|
||||
this.post('/api/worktree/checkout-branch', { worktreePath, branchName, baseBranch }),
|
||||
checkoutBranch: (
|
||||
worktreePath: string,
|
||||
branchName: string,
|
||||
baseBranch?: string,
|
||||
stashChanges?: boolean,
|
||||
includeUntracked?: boolean
|
||||
) =>
|
||||
this.post('/api/worktree/checkout-branch', {
|
||||
worktreePath,
|
||||
branchName,
|
||||
baseBranch,
|
||||
stashChanges,
|
||||
includeUntracked,
|
||||
}),
|
||||
checkChanges: (worktreePath: string) =>
|
||||
this.post('/api/worktree/check-changes', { worktreePath }),
|
||||
listBranches: (worktreePath: string, includeRemote?: boolean) =>
|
||||
this.post('/api/worktree/list-branches', { worktreePath, includeRemote }),
|
||||
switchBranch: (worktreePath: string, branchName: string) =>
|
||||
|
||||
Reference in New Issue
Block a user