Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/Files.App/Utils/Git/GitHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -870,10 +870,11 @@ public static (string RepoUrl, string RepoName) GetRepoInfo(string url)
if (!match.Success)
return (string.Empty, string.Empty);

string platform = match.Groups["domain"].Value;
string userOrOrg = match.Groups["user"].Value;
string repoName = match.Groups["repo"].Value;

string repoUrl = $"https://github.com/{userOrOrg}/{repoName}";
string repoUrl = $"https://{platform}.com/{userOrOrg}/{repoName}";
return (repoUrl, repoName);
}

Expand Down Expand Up @@ -943,7 +944,7 @@ public static async Task CloneRepoAsync(string repoUrl, string repoName, string
ReturnResult.Failed);
}

[GeneratedRegex(@"^(?:https?:\/\/)?(?:www\.)?github\.com\/(?<user>[^\/]+)\/(?<repo>[^\/]+?)(?=\.git|\/|$)(?:\.git)?(?:\/)?", RegexOptions.IgnoreCase)]
[GeneratedRegex(@"^(?:https?:\/\/)?(?:www\.)?(?<domain>github|gitlab)\.com\/(?<user>[^\/]+)\/(?<repo>[^\/]+?)(?=\.git|\/|$)(?:\.git)?(?:\/)?", RegexOptions.IgnoreCase)]
private static partial Regex GitHubRepositoryRegex();
}
}
Loading