fix: allow PR worktrees from existing local branches
Use existing local PR branches instead of blocking worktree creation Only block PR branches already checked out in another worktree Clarify local branch validation messages across locales
This commit is contained in:
@@ -195,13 +195,15 @@ export function GitHubIntegrationDialog({
|
||||
worktreeName: branchName,
|
||||
});
|
||||
|
||||
const isBlocked = result.errors.some(
|
||||
(entry) => entry.code === 'branch_in_use' || entry.code === 'branch_exists'
|
||||
);
|
||||
const blockingError = result.errors.find((entry) => entry.code === 'branch_in_use');
|
||||
|
||||
setValidations(prev => new Map(prev).set(branchName, {
|
||||
isValid: !isBlocked,
|
||||
error: isBlocked ? t('session.githubIntegration.validation.branchAlreadyCheckedOut') : null,
|
||||
isValid: !blockingError,
|
||||
error: blockingError
|
||||
? t(blockingError.code === 'branch_exists'
|
||||
? 'session.githubIntegration.validation.branchAlreadyExists'
|
||||
: 'session.githubIntegration.validation.branchAlreadyCheckedOut')
|
||||
: null,
|
||||
}));
|
||||
} catch {
|
||||
setValidations(prev => new Map(prev).set(branchName, {
|
||||
|
||||
Reference in New Issue
Block a user