diff --git a/src/ModuleCore/Git/GitManager.cs b/src/ModuleCore/Git/GitManager.cs index 36f2886..b0e847a 100644 --- a/src/ModuleCore/Git/GitManager.cs +++ b/src/ModuleCore/Git/GitManager.cs @@ -10,9 +10,9 @@ namespace ModuleCore.Git; public class GitManager { private static readonly Lazy GitManagerInstance = new(() => new GitManager()); - private readonly ConcurrentDictionary _registrations; - private readonly DatabaseManager _db; private static Action? _debugWriterDelegate; + private readonly DatabaseManager _db; + private readonly ConcurrentDictionary _registrations; private GitManager() { @@ -22,6 +22,13 @@ public class GitManager InitialiseRegistrations(); } + public static GitManager Instance => GitManagerInstance.Value; + + /// + /// Always returns a new clean instance of GitManager + /// + internal static GitManager InternalFreshInstance => new(); + /// /// Creates up any database tables and loads all previously saved git registrations. /// @@ -56,13 +63,6 @@ public class GitManager } } - public static GitManager Instance => GitManagerInstance.Value; - - /// - /// Always returns a new clean instance of GitManager - /// - internal static GitManager InternalFreshInstance => new(); - /// /// Registers a git repository based on an absolute location. If is null or empty, /// the registration will use the folder name for the git repo at the top level. @@ -146,7 +146,7 @@ public class GitManager } /// - /// Registers an output for debug output. should be called as soon as the need for output + /// Registers an output for debug output. should be called as soon as the need for output /// is no longer needed. /// /// @@ -156,7 +156,7 @@ public class GitManager } /// - /// Clears any output previously registered with + /// Clears any output previously registered with /// public static void ClearDebugWriter() { @@ -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; }