refactor(coding-agent): centralize git url detection

This commit is contained in:
Mario Zechner 2026-01-24 01:02:16 +01:00
parent 4719929f6a
commit 254c00b788
3 changed files with 8 additions and 37 deletions

View file

@ -0,0 +1,6 @@
const GIT_HOSTS = ["github.com", "gitlab.com", "bitbucket.org", "codeberg.org"];
export function looksLikeGitUrl(source: string): boolean {
const normalized = source.replace(/^https?:\/\//, "");
return GIT_HOSTS.some((host) => normalized.startsWith(`${host}/`));
}