Skip to content

Commit 13a4c59

Browse files
authored
only show menu option if >1 github remote (#7651)
1 parent 0bec24f commit 13a4c59

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2667,7 +2667,7 @@
26672667
},
26682668
{
26692669
"command": "pr.preferredCodingAgentGitHubRemote",
2670-
"when": "view == workbench.view.chat.sessions.copilot-swe-agent",
2670+
"when": "github:hasMultipleGitHubRemotes && view == workbench.view.chat.sessions.copilot-swe-agent",
26712671
"group": "navigation@1"
26722672
}
26732673
],

src/github/folderRepositoryManager.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,9 @@ export class FolderRepositoryManager extends Disposable {
428428
if (activeRemotes.length) {
429429
await vscode.commands.executeCommand('setContext', 'github:hasGitHubRemotes', true);
430430
Logger.appendLine(`Found GitHub remote for folder ${this.repository.rootUri.fsPath}`, this.id);
431+
if (this._allGitHubRemotes.length > 1) {
432+
await vscode.commands.executeCommand('setContext', 'github:hasMultipleGitHubRemotes', true);
433+
}
431434
} else {
432435
Logger.appendLine(`No GitHub remotes found for folder ${this.repository.rootUri.fsPath}`, this.id);
433436
}

0 commit comments

Comments
 (0)