Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/gittensory-mcp/lib/local-branch.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { fileURLToPath } from "node:url";
const packageRoot = join(dirname(fileURLToPath(import.meta.url)), "..");

export function parseGitRemote(remoteUrl) {
const trimmed = String(remoteUrl ?? "").trim();
const trimmed = String(remoteUrl ?? "").trim().replace(/\/+$/, "");
const patterns = [
/^git@github\.com:([^/]+)\/(.+?)(?:\.git)?$/,
/^https:\/\/github\.com\/([^/]+)\/(.+?)(?:\.git)?$/,
Expand Down
1 change: 1 addition & 0 deletions test/unit/local-branch.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1676,6 +1676,7 @@ describe("local MCP git metadata collection", () => {
const { collectLocalBranchMetadata, parseGitRemote } = await import("../../packages/gittensory-mcp/lib/local-branch.js");
expect(parseGitRemote("git@github.com:entrius/allways-ui.git")).toBe("entrius/allways-ui");
expect(parseGitRemote("https://github.com/JSONbored/gittensory.git")).toBe("JSONbored/gittensory");
expect(parseGitRemote("https://github.com/JSONbored/gittensory/")).toBe("JSONbored/gittensory");

tempDir = mkdtempSync(join(tmpdir(), "gittensory-local-"));
git(tempDir, "init");
Expand Down