fix(coding-agent): normalize raw git URLs in extension source matching

- Handle https://github.com/... URLs as git sources (not local)
- Strip .git suffix for consistent matching
This commit is contained in:
Mario Zechner 2026-01-22 14:19:04 +01:00
parent d99b7057ca
commit d89f6e08ce
2 changed files with 7 additions and 1 deletions

View file

@ -88,7 +88,12 @@ function normalizeExtensionSource(source: string): { type: "npm" | "git" | "loca
}
if (source.startsWith("git:")) {
const repo = source.slice("git:".length).trim().split("@")[0] ?? "";
return { type: "git", key: repo.replace(/^https?:\/\//, "") };
return { type: "git", key: repo.replace(/^https?:\/\//, "").replace(/\.git$/, "") };
}
// Raw git URLs
if (source.startsWith("https://") || source.startsWith("http://")) {
const repo = source.split("@")[0] ?? "";
return { type: "git", key: repo.replace(/^https?:\/\//, "").replace(/\.git$/, "") };
}
return { type: "local", key: source };
}