Sessions - update order for setting the default value for the branch picker (#307053)

This commit is contained in:
Ladislau Szomoru
2026-04-01 08:16:17 +00:00
committed by GitHub
parent a1ceb20175
commit accaa4d82a
2 changed files with 2 additions and 6 deletions

View File

@@ -1,4 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

View File

@@ -235,9 +235,9 @@ export class CopilotCLISession extends Disposable implements ISessionData {
.filter((name): name is string => !!name)
.filter(name => !name.includes(CopilotCLISession.COPILOT_WORKTREE_PATTERN));
const defaultBranch = branches.find(b => b === repo.state.get().HEAD?.name)
?? branches.find(b => b === 'main')
const defaultBranch = branches.find(b => b === 'main')
?? branches.find(b => b === 'master')
?? branches.find(b => b === repo.state.get().HEAD?.name)
?? branches[0];
this._defaultBranch = defaultBranch;