diff --git a/packages/gittensory-mcp/lib/local-branch.js b/packages/gittensory-mcp/lib/local-branch.js index 95bfb25e1e..4e34385d5b 100644 --- a/packages/gittensory-mcp/lib/local-branch.js +++ b/packages/gittensory-mcp/lib/local-branch.js @@ -16,7 +16,9 @@ export function parseGitRemote(remoteUrl) { const patterns = [ /^git@github\.com:([^/]+)\/(.+?)(?:\.git)?$/, /^https:\/\/github\.com\/([^/]+)\/(.+?)(?:\.git)?$/, + /^http:\/\/github\.com\/([^/]+)\/(.+?)(?:\.git)?$/, /^ssh:\/\/git@github\.com\/([^/]+)\/(.+?)(?:\.git)?$/, + /^git:\/\/github\.com\/([^/]+)\/(.+?)(?:\.git)?$/, ]; for (const pattern of patterns) { const match = trimmed.match(pattern); diff --git a/test/unit/local-branch.test.ts b/test/unit/local-branch.test.ts index 16ad62dff5..50af3ac1e4 100644 --- a/test/unit/local-branch.test.ts +++ b/test/unit/local-branch.test.ts @@ -1759,6 +1759,8 @@ describe("local MCP git metadata collection", () => { expect(parseGitRemote("https://github.com/JSONbored/gittensory.git")).toBe("JSONbored/gittensory"); expect(parseGitRemote("https://github.com/JSONbored/gittensory/")).toBe("JSONbored/gittensory"); expect(parseGitRemote("https://github.com/JSONbored/gittensory////")).toBe("JSONbored/gittensory"); + expect(parseGitRemote("http://github.com/JSONbored/gittensory.git")).toBe("JSONbored/gittensory"); + expect(parseGitRemote("git://github.com/JSONbored/gittensory.git")).toBe("JSONbored/gittensory"); expect(parseGitRemote(`x${"/".repeat(32_000)}x`)).toBeUndefined(); tempDir = mkdtempSync(join(tmpdir(), "gittensory-local-"));