Compare commits

..

1 Commits

Author SHA1 Message Date
Loic Duong 44f7572167 fix(installer): support ssh custom-source ports 2026-06-18 15:32:56 +07:00
2 changed files with 1 additions and 21 deletions

View File

@ -220,23 +220,6 @@ 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}`); 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'); const result = manager.parseSource('ssh://git@host/owner/repo.git');
assert(result.isValid === true, 'SSH protocol URL without custom port remains valid'); assert(result.isValid === true, 'SSH protocol URL without custom port remains valid');

View File

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