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

Co-authored-by: Julius Marminge <[email protected]>
Signed-off-by: Pujitha Paladugu <[email protected]>
This commit is contained in:
Pujitha PaladuguandJulius Marminge authored and GitHub committed 2026-09-28 18:00:36 -07:00
1 parent b21f3b7191
commit 38f3c62304
2 files changed
+14

No files matched your search

@@ -242,6 +242,18 @@ describe("legacyLinkedPullRequestOf", () => {
it("does not guess when the project identity is unavailable", () => {
expect(legacyLinkedPullRequestOf([link(7)], "project-1" as never, null)).toBeNull();
});
it("does not route links for a local-path remote with no host or provider", () => {
const localIdentity = {
canonicalKey: "/tmp/r/remote",
displayName: "remote",
locator: {
source: "git-remote" as const,
remoteName: "origin",
remoteUrl: "/tmp/r/remote.git",
},
};
expect(legacyLinkedPullRequestOf([link(7)], "project-1" as never, localIdentity)).toBeNull();
});
});
describe("resolveThreadPullRequestChains", () => {
@@ -157,7 +157,9 @@ export function legacyLinkedPullRequestOf(
identity: RepositoryIdentity | null | undefined,
): ThreadLinkedPullRequest | null {
if (!identity) return null;
// A local-path remote has no host segment and no provider, so there is no host to match.
const host = pullRequestHostOf(identity, identity.provider as SourceControlProviderKind);
if (typeof host !== "string") return null;
const repository = sourceControlRepositorySelector(identity);
if (repository === null) return null;
const azureKey =