authorgravatar for pujitha.rathna@gmail.comPujitha Paladugu <pujitha.rathna@gmail.com> 2026-09-28 18:00:36-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-09-28 18:00:36-07:00
log38f3c62304bfe79ea6c9f75a17afb732b555f48d
tree009de3770c650ff5d213e873166c29364803e47e
parentb21f3b71913370a1a650a61fd9082f992d40e657
signature Signed by PGP key B5690EEEBB952194

fix(shared): local-path remotes no longer crash legacy PR link projection (#13463)

Co-authored-by: Julius Marminge <julius0216@outlook.com> Signed-off-by: Pujitha Paladugu <10557236+pujitha24@users.noreply.github.com>

2 files changed, 14 insertions(+), 0 deletions(-)

packages/shared/src/threadPullRequests.test.ts+12
......@@ -242,6 +242,18 @@ describe("legacyLinkedPullRequestOf", () => {
242242 it("does not guess when the project identity is unavailable", () => {
243243 expect(legacyLinkedPullRequestOf([link(7)], "project-1" as never, null)).toBeNull();
244244 });
245 it("does not route links for a local-path remote with no host or provider", () => {
246 const localIdentity = {
247 canonicalKey: "/tmp/r/remote",
248 displayName: "remote",
249 locator: {
250 source: "git-remote" as const,
251 remoteName: "origin",
252 remoteUrl: "/tmp/r/remote.git",
253 },
254 };
255 expect(legacyLinkedPullRequestOf([link(7)], "project-1" as never, localIdentity)).toBeNull();
256 });
245257});
246258
247259describe("resolveThreadPullRequestChains", () => {
packages/shared/src/threadPullRequests.ts+2
......@@ -157,7 +157,9 @@ export function legacyLinkedPullRequestOf(
157157 identity: RepositoryIdentity | null | undefined,
158158): ThreadLinkedPullRequest | null {
159159 if (!identity) return null;
160 // A local-path remote has no host segment and no provider, so there is no host to match.
160161 const host = pullRequestHostOf(identity, identity.provider as SourceControlProviderKind);
162 if (typeof host !== "string") return null;
161163 const repository = sourceControlRepositorySelector(identity);
162164 if (repository === null) return null;
163165 const azureKey =