Fix New Workspace PR worktree creation (#1565)
* Fix PR worktree creation from New Workspace * Use fixture default branch in GitHub E2E clone
This commit is contained in:
@@ -20,11 +20,13 @@ export function pickerItemToCheckoutRequest(
|
||||
switch (item.kind) {
|
||||
case "branch":
|
||||
return { action: "branch-off", refName: item.name };
|
||||
case "github-pr":
|
||||
case "github-pr": {
|
||||
const headRefName = item.item.headRefName?.trim();
|
||||
return {
|
||||
action: "checkout",
|
||||
refName: item.item.headRefName ?? "",
|
||||
...(headRefName ? { refName: headRefName } : {}),
|
||||
githubPrNumber: item.item.number,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -804,8 +804,8 @@ async function createMultiplicityWorkspace(input: {
|
||||
createFailedMessage: string;
|
||||
}): Promise<ReturnType<typeof normalizeWorkspaceDescriptor>> {
|
||||
const isWorktree = input.isolation === "worktree";
|
||||
const baseBranch = isWorktree
|
||||
? (resolveCheckoutRequest(input.selectedItem, input.currentBranch)?.refName ?? undefined)
|
||||
const checkoutRequest = isWorktree
|
||||
? resolveCheckoutRequest(input.selectedItem, input.currentBranch)
|
||||
: undefined;
|
||||
const firstAgentContext = buildFirstAgentContext({
|
||||
prompt: input.prompt,
|
||||
@@ -818,7 +818,7 @@ async function createMultiplicityWorkspace(input: {
|
||||
cwd: input.project.iconWorkingDir,
|
||||
projectId: input.project.projectKey,
|
||||
worktreeSlug: createNameId(),
|
||||
...(baseBranch ? { baseBranch } : {}),
|
||||
...checkoutRequest,
|
||||
}
|
||||
: {
|
||||
kind: "directory",
|
||||
|
||||
Reference in New Issue
Block a user