@@ -832,16 +832,23 @@ export class IssueFeatureRegistrar extends Disposable {
832832 if ( workingBaseBranchConfig === 'defaultBranch' ) {
833833 checkoutDefaultBranch = true ;
834834 } else if ( workingBaseBranchConfig === 'prompt' ) {
835- const currentBranchOption = vscode . l10n . t ( 'Current Branch' ) ;
836- const defaultBranchOption = vscode . l10n . t ( 'Default Branch' ) ;
837- const choice = await vscode . window . showQuickPick ( [ currentBranchOption , defaultBranchOption ] , {
838- placeHolder : vscode . l10n . t ( 'Which branch should be used as the base for the new issue branch?' ) ,
839- } ) ;
840- if ( choice === undefined ) {
841- // User cancelled the prompt
842- return ;
835+ const currentBranchName = repoManager . repository . state . HEAD ?. name ;
836+ const defaults = await repoManager . getPullRequestDefaults ( ) ;
837+ const defaultBranchName = defaults . base ;
838+
839+ if ( ! currentBranchName ) {
840+ // If we can't determine the current branch, default to the default branch
841+ checkoutDefaultBranch = true ;
842+ } else {
843+ const choice = await vscode . window . showQuickPick ( [ currentBranchName , defaultBranchName ] , {
844+ placeHolder : vscode . l10n . t ( 'Which branch should be used as the base for the new issue branch?' ) ,
845+ } ) ;
846+ if ( choice === undefined ) {
847+ // User cancelled the prompt
848+ return ;
849+ }
850+ checkoutDefaultBranch = choice === defaultBranchName ;
843851 }
844- checkoutDefaultBranch = choice === defaultBranchOption ;
845852 }
846853 // else workingBaseBranchConfig === 'currentBranch', checkoutDefaultBranch remains false
847854
0 commit comments