Error handling of create worktree and fix create worktree... command from command palette (#257172)

* esc when creating worktree name cancels create operation

* Find main repo for createworktree command palette to prevent repo picker

* error handling of creating worktree

* add back repo picker for create worktree... command
This commit is contained in:
Christy 😺
2025-07-22 07:37:50 -07:00
committed by GitHub
parent c7ad864491
commit 2b37aecab3
3 changed files with 42 additions and 5 deletions

View File

@@ -351,6 +351,8 @@ function getGitErrorCode(stderr: string): string | undefined {
return GitErrorCodes.NotASafeGitRepository;
} else if (/contains modified or untracked files|use --force to delete it/.test(stderr)) {
return GitErrorCodes.WorktreeContainsChanges;
} else if (/is already used by worktree at|already exists/.test(stderr)) {
return GitErrorCodes.WorktreeAlreadyExists;
}
return undefined;