Exemple #1
0
        public static RepositoryManager CreateInstance(IPlatform platform, ITaskManager taskManager, IUsageTracker usageTracker,
                                                       IGitClient gitClient, NPath repositoryRoot)
        {
            var    repositoryPathConfiguration = new RepositoryPathConfiguration(repositoryRoot);
            string filePath  = repositoryPathConfiguration.DotGitConfig;
            var    gitConfig = new GitConfig(filePath);

            var repositoryWatcher = new RepositoryWatcher(platform, repositoryPathConfiguration, taskManager.Token);

            return(new RepositoryManager(platform, taskManager, usageTracker, gitConfig, repositoryWatcher,
                                         gitClient, repositoryPathConfiguration, taskManager.Token));
        }
Exemple #2
0
        public static RepositoryManager CreateInstance(IPlatform platform, ITaskManager taskManager, IGitClient gitClient,
                                                       IProcessManager processManager, IFileSystem fileSystem, NPath repositoryRoot)
        {
            var    repositoryPathConfiguration = new RepositoryPathConfiguration(repositoryRoot);
            string filePath  = repositoryPathConfiguration.DotGitConfig;
            var    gitConfig = new GitConfig(filePath);

            var repositoryWatcher = new RepositoryWatcher(platform, repositoryPathConfiguration, taskManager.Token);

            return(new RepositoryManager(gitConfig, repositoryWatcher,
                                         gitClient, processManager, fileSystem,
                                         taskManager.Token, repositoryPathConfiguration));
        }
        public void RestartRepository()
        {
            Environment.InitializeRepository();
            if (Environment.RepositoryPath != null)
            {
                var repositoryPathConfiguration = new RepositoryPathConfiguration(Environment.RepositoryPath);
                var gitConfig = new GitConfig(repositoryPathConfiguration.DotGitConfig);

                var repositoryWatcher = new RepositoryWatcher(Platform, repositoryPathConfiguration, TaskManager.Token);
                repositoryManager = new RepositoryManager(Platform, TaskManager, UsageTracker, gitConfig, repositoryWatcher,
                                                          GitClient, repositoryPathConfiguration, TaskManager.Token);
                Environment.Repository = repositoryManager.Repository;
                Logger.Trace($"Got a repository? {Environment.Repository}");
            }
        }