fix(github): read a choice saved without a host as github.com's (#6753)

Follow-up to #6746. A repository choice saved as owner/name comes from a release that knew only github.com, so it now means github.com's repository of that name, and the Enterprise one only when github.com has none; #6746 had read it as the origin remote's, which reconnected some projects to the Enterprise server. The probe that picks where to ask gh follows the same rule and finds an Enterprise repository by its remote's path.

Co-authored-by: wildcatDownstairs <[email protected]>
Цей коміт міститься в:
LU XIANGRUIтаwildcatDownstairs authored and GitHub committed 2026-11-29 10:03:56 +08:00
1 джерело 633bef2e69
коміт 3bc75e1de0
3 files changed
+69 -20

No files matched your search

+8
Переглянути файл
@@ -64,6 +64,14 @@ describe("merge direction", () => {
defaultBranch: "main",
});
expect(d.headRepo).toBe(ghe);
// Its github.com upstream still names the branch to look for an open pull request with, but it is
// no push target for the Enterprise head: creating asks for the branch name and pushes to origin.
const names = ["origin", "fork", "public"];
expect(trackedHead({ kind: "local", name: "feature" }, tracking, names)).toEqual({
remote: "public",
name: "feature",
});
expect(pushTarget(tracking, "feature", ghe.remote, names)).toBeNull();
});
it("splits remote branches by the longest remote name", () => {