From 73fc3b469be0e4038abe19c0f171bf8e1abdf67b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 27 Aug 2026 16:04:31 +0000 Subject: [PATCH 1/3] Initial plan From 223c7f371ee3a39248ea43e30dfe2bf8111e4979 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 27 Aug 2026 16:12:30 +0000 Subject: [PATCH 2/3] Handle local branch upstreams Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com> --- src/github/folderRepositoryManager.ts | 3 +- .../github/folderRepositoryManager.test.ts | 31 ++++++++++++++++++- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/src/github/folderRepositoryManager.ts b/src/github/folderRepositoryManager.ts index 7c60de352c..b398e27722 100644 --- a/src/github/folderRepositoryManager.ts +++ b/src/github/folderRepositoryManager.ts @@ -1664,7 +1664,8 @@ export class FolderRepositoryManager extends Disposable { } const upstreamRef = branch ? branch.upstream : this.upstreamRef; - if (upstreamRef) { + // A remote of "." means the branch tracks another local branch. + if (upstreamRef && upstreamRef.remote !== '.') { // If our current branch has an upstream ref set, find its GitHubRepository. const upstream = this.findRepo(byRemoteName(upstreamRef.remote)); diff --git a/src/test/github/folderRepositoryManager.test.ts b/src/test/github/folderRepositoryManager.test.ts index 61d3c2f244..5ff6a3870c 100644 --- a/src/test/github/folderRepositoryManager.test.ts +++ b/src/test/github/folderRepositoryManager.test.ts @@ -16,7 +16,7 @@ import { Protocol } from '../../common/protocol'; import { GitHubRepository } from '../../github/githubRepository'; import { PullRequestBuilder } from '../builders/rest/pullRequestBuilder'; import { convertRESTPullRequestToRawPullRequest } from '../../github/utils'; -import { GitApiImpl } from '../../api/api1'; +import { GitApiImpl, RefType } from '../../api/api1'; import { CredentialStore } from '../../github/credentials'; import { MockExtensionContext } from '../mocks/mockExtensionContext'; import { Uri } from 'vscode'; @@ -87,6 +87,35 @@ describe('PullRequestManager', function () { }); }); + describe('getPullRequestDefaults', function () { + it('uses a GitHub remote when the branch tracks a local sibling branch', async function () { + const url = 'https://github.com/owner/repo.git'; + const remote = new GitHubRemote('origin', url, new Protocol(url), GitHubServerType.GitHubDotCom); + const githubRepository = new GitHubRepository(1, remote, repository.rootUri, manager.credentialStore, telemetry); + (manager as any)._githubRepositories = [githubRepository]; + sinon.stub(githubRepository, 'getMetadata').resolves({ + owner: { login: 'owner' }, + name: 'repo', + default_branch: 'main', + } as any); + + const defaults = await manager.getPullRequestDefaults({ + type: RefType.Head, + name: 'feature-b', + upstream: { + remote: '.', + name: 'feature-a', + }, + }); + + assert.deepStrictEqual(defaults, { + owner: 'owner', + repo: 'repo', + base: 'main', + }); + }); + }); + describe('activePullRequest', function () { it('gets and sets the active pull request', function () { assert.strictEqual(manager.activePullRequest, undefined); From 235ba5e1f131c15dcce918a7f5930c0a8c27ea04 Mon Sep 17 00:00:00 2001 From: Alex Ross <38270282+alexr00@users.noreply.github.com> Date: Fri, 28 Aug 2026 12:42:48 +0200 Subject: [PATCH 3/3] Attestation commit