Git - expose random name generation for branches (#298938)

This commit is contained in:
Ladislau Szomoru
2026-03-03 13:45:46 +01:00
committed by GitHub
parent 8c6874835d
commit fb87d94563
5 changed files with 62 additions and 47 deletions

View File

@@ -867,10 +867,12 @@ export function getStashDescription(stash: Stash): string | undefined {
return descriptionSegments.join(' \u2022 ');
}
export const CopilotWorktreeBranchPrefix = 'copilot-worktree-';
export function isCopilotWorktree(path: string): boolean {
const lastSepIndex = path.lastIndexOf(sep);
return lastSepIndex !== -1
? path.substring(lastSepIndex + 1).startsWith('copilot-worktree-')
: path.startsWith('copilot-worktree-');
? path.substring(lastSepIndex + 1).startsWith(CopilotWorktreeBranchPrefix)
: path.startsWith(CopilotWorktreeBranchPrefix);
}