Compare commits

..

4 Commits

Author SHA1 Message Date
Loic Duong c5f7de38e2 fix(installer): preserve encoded ssh auth 2026-06-19 10:27:58 +07:00
Loic Duong 16ff771941 fix(installer): normalize ssh custom-source clone urls 2026-06-19 10:17:24 +07:00
Loic Duong ea557079f0 fix(installer): preserve posix custom-source cache paths 2026-06-19 10:16:03 +07:00
Loic Duong 87d194b93e fix(installer): support ssh custom-source ports 2026-06-18 14:51:26 +07:00
2 changed files with 21 additions and 1 deletions

View File

@ -220,6 +220,23 @@ console.log(`\n${colors.cyan}Simple owner/repo URLs (regression check)${colors.r
assert(result.displayName === 'path/repo', 'SSH protocol custom-port displayName uses last two segments', `Got: ${result.displayName}`);
}
{
const result = manager.parseSource('ssh://git@host:2222/path/repo.git?foo=bar#readme');
assert(result.isValid === true, 'SSH protocol URL with query and hash is valid');
assert(result.cloneUrl === 'ssh://git@host:2222/path/repo.git', 'SSH protocol cloneUrl drops query and hash', `Got: ${result.cloneUrl}`);
assert(result.cacheKey === 'host:2222/path/repo', 'SSH protocol query/hash cacheKey ignores query and hash', `Got: ${result.cacheKey}`);
}
{
const result = manager.parseSource('ssh://git%40corp@host:2222/path/repo.git?foo=bar#readme');
assert(result.isValid === true, 'SSH protocol URL with encoded username is valid');
assert(
result.cloneUrl === 'ssh://git%40corp@host:2222/path/repo.git',
'SSH protocol cloneUrl preserves encoded username',
`Got: ${result.cloneUrl}`,
);
}
{
const result = manager.parseSource('ssh://git@host/owner/repo.git');
assert(result.isValid === true, 'SSH protocol URL without custom port remains valid');

View File

@ -171,10 +171,13 @@ class CustomModuleManager {
const repoSeg = segments.at(-1);
const ownerSeg = segments.at(-2);
const displayName = ownerSeg ? `${ownerSeg}/${repoSeg}` : repoSeg;
url.search = '';
url.hash = '';
const cloneUrl = url.toString();
return {
type: 'url',
cloneUrl: trimmed,
cloneUrl,
subdir: null,
localPath: null,
version: versionSuffix || null,