Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(shared): resolve multi-account SSH alias hosts to the real provider host #9497

ClosedMnigos(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/9497/headopened View on GitHub

Showing 5 changed files with 43 additions and 18 deletions (loading 2).

x
0 of 5 viewed, 5 left
1 addition and 14 deletionsapps/server/src/git/GitManager.tsModified
View file
@@ -36,6 +36,7 @@
detectSourceControlProviderFromGitRemoteUrl,
mergeGitStatusParts,
normalizeGitRemoteUrl,
+ parseGitHubRepositoryNameWithOwnerFromRemoteUrl,
resolveAutoFeatureBranchName,
sanitizeBranchFragment,
sanitizeFeatureBranchName,
@@ -235,20 +236,6 @@
return `t3code/pr-${pullRequest.number}/${suffix}`;
​
-function parseGitHubRepositoryNameWithOwnerFromRemoteUrl(url: string | null): string | null {
- const trimmed = url?.trim() ?? "";
- if (trimmed.length === 0) {
- return null;
- }
-​
- const match =
- /^(?:git@github\.com:|ssh:\/\/git@github\.com\/|https:\/\/github\.com\/|git:\/\/github\.com\/)([^/\s]+\/[^/\s]+?)(?:\.git)?\/?$/i.exec(
- trimmed,
- );
- const repositoryNameWithOwner = match?.[1]?.trim() ?? "";
- return repositoryNameWithOwner.length > 0 ? repositoryNameWithOwner : null;
-}
-​
function parseRepositoryOwnerLogin(nameWithOwner: string | null): string | null {
const trimmed = nameWithOwner?.trim() ?? "";
if (trimmed.length === 0) {