chore(git-provider): Code style

This commit is contained in:
Scott 2026-08-24 16:46:35 +10:00
commit 164df4ecf4

View file

@ -10,9 +10,9 @@ namespace ModuleCore.Git;
public class GitManager
{
private static readonly Lazy<GitManager> GitManagerInstance = new(() => new GitManager());
private readonly ConcurrentDictionary<string, InternalGitRegistration> _registrations;
private readonly DatabaseManager _db;
private static Action<string>? _debugWriterDelegate;
private readonly DatabaseManager _db;
private readonly ConcurrentDictionary<string, InternalGitRegistration> _registrations;
private GitManager()
{
@ -22,6 +22,13 @@ public class GitManager
InitialiseRegistrations();
}
public static GitManager Instance => GitManagerInstance.Value;
/// <summary>
/// Always returns a new clean instance of GitManager
/// </summary>
internal static GitManager InternalFreshInstance => new();
/// <summary>
/// Creates up any database tables and loads all previously saved git registrations.
/// </summary>
@ -56,13 +63,6 @@ public class GitManager
}
}
public static GitManager Instance => GitManagerInstance.Value;
/// <summary>
/// Always returns a new clean instance of GitManager
/// </summary>
internal static GitManager InternalFreshInstance => new();
/// <summary>
/// Registers a git repository based on an absolute location. If <paramref name="registrationName" /> is null or empty,
/// the registration will use the folder name for the git repo at the top level.
@ -169,9 +169,9 @@ public class GitManager
[Table(TableName)]
private class InternalGitRegistration
{
internal const string TableName = "GitRegistration";
private string _currentBranch = string.Empty;
private long _nextCheckTime;
internal const string TableName = "GitRegistration";
[PrimaryKey]
public Guid Id { get; set; }