Skip to content

Commit 6482dc8

Browse files
Copilotalexr00
andcommitted
Fix: Don't prompt to fetch additional remotes when explicitly configured
When users explicitly configure githubPullRequests.remotes, the extension should automatically fetch from all configured remotes instead of prompting "Continue fetching from other remotes" after finding results in the first one. This change modifies the fetchPagedData method to detect when remotes have been explicitly configured (via global, workspace, or folder settings) and skips the early break logic that was causing the prompt to appear. Fixes microsoft/vscode-pull-request-github#XXXXX Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
1 parent 1c2f23d commit 6482dc8

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/github/folderRepositoryManager.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1086,6 +1086,10 @@ export class FolderRepositoryManager extends Disposable {
10861086

10871087
const activeGitHubRemotes = await this.getActiveGitHubRemotes(this._allGitHubRemotes);
10881088

1089+
// Check if user has explicitly configured remotes (not using defaults)
1090+
const remotesConfig = vscode.workspace.getConfiguration(PR_SETTINGS_NAMESPACE).inspect<string[]>(REMOTES);
1091+
const hasExplicitRemotesConfig = !!(remotesConfig?.globalValue || remotesConfig?.workspaceValue || remotesConfig?.workspaceFolderValue);
1092+
10891093
const githubRepositories = this._githubRepositories.filter(repo => {
10901094
if (!activeGitHubRemotes.find(r => r.equals(repo.remote))) {
10911095
return false;
@@ -1152,10 +1156,12 @@ export class FolderRepositoryManager extends Disposable {
11521156
// 1) we've received data AND
11531157
// 2) either we're fetching just the next page (case 2)
11541158
// OR we're fetching all (cases 1&3), and we've fetched as far as we had previously (or further, in case 1).
1159+
// 3) AND the user hasn't explicitly configured remotes (if they have, we should search all of them)
11551160
if (
11561161
itemData.items.length &&
11571162
(options.fetchNextPage ||
1158-
((options.fetchNextPage === false) && !options.fetchOnePagePerRepo && (pagesFetched >= getTotalFetchedPages())))
1163+
((options.fetchNextPage === false) && !options.fetchOnePagePerRepo && (pagesFetched >= getTotalFetchedPages()))) &&
1164+
!hasExplicitRemotesConfig
11591165
) {
11601166
if (getTotalFetchedPages() === 0) {
11611167
// We're in case 1, manually set number of pages we looked through until we found first results.

0 commit comments

Comments
 (0)