Stop showing cached PRs when we no longer have a base remote (#5543)

If we used to have a base remote (e.g. because there was only one), but
now we don't (e.g. because the user has added a second one, and we don't
know yet which one is the base), stop showing the cached PRs. This is
especially important in the case that the user cancels the prompt, in
which case we don't have a base remote for the rest of the session, but
would keep showing the (potentially stale) cached PRs forever.

You might ask why we don't retain the previous base remote in the case
that we used to have one but no longer do; this may be possible, but
it's error-prone because the user might have shuffled their remotes
around and changed their names. I don't think it's worth the risk.
This commit is contained in:
Stefan Haller 2026-04-26 16:53:22 +02:00 committed by GitHub
commit c826d83697
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -819,6 +819,9 @@ func (self *RefreshHelper) refreshGithubPullRequests() {
baseRemote := self.getGithubBaseRemote()
if baseRemote == nil {
self.c.Model().PullRequests = nil
self.c.Model().PullRequestsMap = nil
if !self.githubBaseRemotePromptDismissed[self.c.Git().RepoPaths.RepoPath()] {
self.promptForBaseGithubRepo(authToken)
}