From 7dbfe4a6597a1dab54fbd2b342672dbdc6534485 Mon Sep 17 00:00:00 2001 From: M-L-Ml Date: Mon, 21 Apr 2025 18:58:40 +0200 Subject: [PATCH] ProviderInfo --- src/Models/CommitLink.cs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/Models/CommitLink.cs b/src/Models/CommitLink.cs index d8a7af32..daf8b019 100644 --- a/src/Models/CommitLink.cs +++ b/src/Models/CommitLink.cs @@ -17,15 +17,17 @@ namespace SourceGit.Models URLPrefix = prefix; } - private static readonly (string Host, string Display, string CommitPath, int NameStart)[] Providers = new[] + public readonly record struct ProviderInfo(string Host, string Display, string CommitPath, int NameStart); + + private static readonly ProviderInfo[] Providers = new[] { - ("https://github.com/", "Github", "/commit/", 19), - ("https://gitlab.", "GitLab", "/-/commit/", 15), - ("https://gitee.com/", "Gitee", "/commit/", 18), - ("https://bitbucket.org/", "BitBucket", "/commits/", 22), - ("https://codeberg.org/", "Codeberg", "/commit/", 21), - ("https://gitea.org/", "Gitea", "/commit/", 18), - ("https://git.sr.ht/", "sourcehut", "/commit/", 18) + new ProviderInfo("https://github.com/", "Github", "/commit/", 19), + new ProviderInfo("https://gitlab.", "GitLab", "/-/commit/", 15), + new ProviderInfo("https://gitee.com/", "Gitee", "/commit/", 18), + new ProviderInfo("https://bitbucket.org/", "BitBucket", "/commits/", 22), + new ProviderInfo("https://codeberg.org/", "Codeberg", "/commit/", 21), + new ProviderInfo("https://gitea.org/", "Gitea", "/commit/", 18), + new ProviderInfo("https://git.sr.ht/", "sourcehut", "/commit/", 18) }; public static List Get(List remotes)