コード例 #1
0
ファイル: RepositoryManager.cs プロジェクト: knsh14/Unity
        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));
        }
コード例 #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));
        }
コード例 #3
0
        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}");
            }
        }