Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

projectThreadCreationValidation.ts

10 lines376 Bytes

1export function resolveProjectThreadCreationBranch(input: {
2 readonly workspaceMode: "local" | "worktree";
3 readonly selectedBranch: string | null;
4 readonly currentCheckoutBranch: string | null;
5}): string | null {
6 if (input.selectedBranch !== null) {
7 return input.selectedBranch;
8 }
9 return input.workspaceMode === "local" ? input.currentCheckoutBranch : null;