Beispiel #1
0
        private void PrepareRepo()
        {
            if (this.isRepoInitialized)
            {
                return;
            }
            var repoInfo = this.gasBiz.GetGameArchiveStorageRepoInfo();

            if (!this.gitBiz.IsGitRepository(GlobalConfig.TempRepoPath))
            {
                // 如果还不是Git仓库,则创建目录,Clone仓库
                WinFormsUtil.EnsureDirExists(GlobalConfig.TempRepoPath);
                this.gitBiz.CloneRepo(GlobalConfig.TempRepoPath, repoInfo);
                this.isRepoInitialized = true;
            }
            else
            {
                // 如果已经是Git仓库,则执行pull
                this.isRepoInitialized = true;
            }
            if (this.isRepoInitialized)
            {
                ArchiveRepoStatusLabel.Text = $"存档仓库:{repoInfo.RepoAddress}";
                this.RefreshGameList();
            }
        }