28 lines · 754 B · TypeScript
RawDownload
import type { GitBranch } from "@t3tools/contracts"; interface DeriveSyncedLocalBranchInput {  activeThreadId: string | undefined;  activeWorktreePath: string | null;  envMode: "local" | "worktree";  activeThreadBranch: string | null;  queryBranches: GitBranch[] | undefined;} export function deriveSyncedLocalBranch({  activeThreadId,  activeWorktreePath,  envMode,  activeThreadBranch,  queryBranches,}: DeriveSyncedLocalBranchInput): string | null {  if (!activeThreadId || activeWorktreePath || envMode !== "local") {    return null;  }   const currentBranch = queryBranches?.find((branch) => branch.current);  if (!currentBranch || currentBranch.name === activeThreadBranch) {    return null;  }   return currentBranch.name;}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t