Skip to content

Commit 7191d0f

Browse files
Copilotalexr00
andauthored
Revert getLocalPullRequests change, preparing fix in validateState
Agent-Logs-Url: https://github.com/microsoft/vscode-pull-request-github/sessions/faa71328-7879-45c0-84f3-d9d1efb039e4 Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
1 parent 682a3bc commit 7191d0f

File tree

1 file changed

+1
-29
lines changed

1 file changed

+1
-29
lines changed

src/github/folderRepositoryManager.ts

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -963,35 +963,7 @@ export class FolderRepositoryManager extends Disposable {
963963
})));
964964
}
965965

966-
const result = models.filter(value => value !== undefined) as PullRequestModel[];
967-
968-
// For the current HEAD branch, if it has an upstream but no PR metadata,
969-
// query GitHub to find an associated PR. This handles PRs created on the
970-
// GitHub website that haven't been checked out through the extension.
971-
const head = this.repository.state.HEAD;
972-
if (head?.name && head.upstream && !result.find(pr => pr.localBranchName === head.name)) {
973-
try {
974-
const metadata = await this.getMatchingPullRequestMetadataFromGitHub(
975-
head,
976-
head.upstream.remote,
977-
undefined,
978-
head.upstream.name,
979-
);
980-
if (metadata) {
981-
await PullRequestGitHelper.associateBranchWithPullRequest(
982-
this.repository,
983-
metadata.model,
984-
head.name,
985-
);
986-
metadata.model.localBranchName = head.name;
987-
result.push(metadata.model);
988-
}
989-
} catch (e) {
990-
Logger.debug(`Error checking GitHub for PR on HEAD branch ${head.name}: ${e}`, this.id);
991-
}
992-
}
993-
994-
return result;
966+
return models.filter(value => value !== undefined) as PullRequestModel[];
995967
}
996968

997969
/**

0 commit comments

Comments
 (0)