This commit is contained in:
nuno maduro
2026-04-27 13:16:05 +01:00
parent f45cbf43c5
commit 81bfdbf8fe
5 changed files with 82 additions and 21 deletions

View File

@ -367,6 +367,15 @@ YAML;
return $m[1];
}
// SSH URL form: ssh://[user@]github.com[:port]/org/repo(.git).
// Some teams configure this explicitly to pin the SSH port; the
// colon-separated form above doesn't match. Mirrors the parser
// in `Storage::originIdentity` so the same remote produces the
// same project key for both storage and remote-fetch.
if (preg_match('#^ssh://(?:[^@/]+@)?github\.com(?::\d+)?/([\w.-]+/[\w.-]+?)(?:\.git)?/?$#i', $url, $m) === 1) {
return $m[1];
}
return null;
}