From 022b266553ca09544bcd33008aa18f024d49d6d7 Mon Sep 17 00:00:00 2001 From: Stanley Goldman Date: Mon, 13 Nov 2017 15:51:13 -0500 Subject: [PATCH 1/2] Revert "Merge pull request #431 from github-for-unity/fixes/refresh-status-and-log-patch" This reverts commit 64e45bd67b28b103eaa8e3a0524d13735891e5cb, reversing changes made to ad226ddadaa621216a96583218fdf8afcbbf1d7a. --- src/GitHub.Api/Git/IRepository.cs | 2 +- src/GitHub.Api/Git/Repository.cs | 5 ----- src/GitHub.Api/Git/RepositoryManager.cs | 8 ++------ .../Assets/Editor/GitHub.Unity/UI/BranchesView.cs | 1 - 4 files changed, 3 insertions(+), 13 deletions(-) diff --git a/src/GitHub.Api/Git/IRepository.cs b/src/GitHub.Api/Git/IRepository.cs index e6117dde8..8ed108a22 100644 --- a/src/GitHub.Api/Git/IRepository.cs +++ b/src/GitHub.Api/Git/IRepository.cs @@ -21,7 +21,7 @@ public interface IRepository : IEquatable void RefreshLog(); void RefreshStatus(); - void UpdateConfigData(); + void CheckLogChangedEvent(CacheUpdateEvent gitLogCacheUpdateEvent); void CheckStatusChangedEvent(CacheUpdateEvent cacheUpdateEvent); void CheckCurrentBranchChangedEvent(CacheUpdateEvent cacheUpdateEvent); diff --git a/src/GitHub.Api/Git/Repository.cs b/src/GitHub.Api/Git/Repository.cs index 916e98dd9..daadaacda 100644 --- a/src/GitHub.Api/Git/Repository.cs +++ b/src/GitHub.Api/Git/Repository.cs @@ -142,11 +142,6 @@ public void RefreshStatus() UpdateGitStatus(); } - public void UpdateConfigData() - { - repositoryManager?.UpdateConfigData(); - } - public void CheckLogChangedEvent(CacheUpdateEvent cacheUpdateEvent) { var managedCache = cacheContainer.GitLogCache; diff --git a/src/GitHub.Api/Git/RepositoryManager.cs b/src/GitHub.Api/Git/RepositoryManager.cs index 16632c33b..fa458c184 100644 --- a/src/GitHub.Api/Git/RepositoryManager.cs +++ b/src/GitHub.Api/Git/RepositoryManager.cs @@ -40,7 +40,6 @@ public interface IRepositoryManager : IDisposable ITask LockFile(string file); ITask UnlockFile(string file, bool force); int WaitForEvents(); - void UpdateConfigData(); IGitConfig Config { get; } IGitClient GitClient { get; } @@ -178,6 +177,7 @@ public ITask CommitAllFiles(string message, string body) add.OnStart += t => IsBusy = true; return add .Then(GitClient.Commit(message, body)) + .Then(UpdateConfigData) .Finally(() => IsBusy = false); } @@ -187,6 +187,7 @@ public ITask CommitFiles(List files, string message, string body) add.OnStart += t => IsBusy = true; return add .Then(GitClient.Commit(message, body)) + .Then(UpdateConfigData) .Finally(() => IsBusy = false); } @@ -297,11 +298,6 @@ public ITask UnlockFile(string file, bool force) return HookupHandlers(task); } - public void UpdateConfigData() - { - UpdateConfigData(false); - } - private void LoadGitUser() { GitClient.GetConfigUserAndEmail() diff --git a/src/UnityExtension/Assets/Editor/GitHub.Unity/UI/BranchesView.cs b/src/UnityExtension/Assets/Editor/GitHub.Unity/UI/BranchesView.cs index 1ef7aa7b2..bd3b70c7b 100644 --- a/src/UnityExtension/Assets/Editor/GitHub.Unity/UI/BranchesView.cs +++ b/src/UnityExtension/Assets/Editor/GitHub.Unity/UI/BranchesView.cs @@ -68,7 +68,6 @@ public override void OnEnable() if (Repository != null) { Repository.CheckLocalAndRemoteBranchListChangedEvent(lastLocalAndRemoteBranchListChangedEvent); - Repository.UpdateConfigData(); } } From 4314b7346acc6c83110b8e4336f76d5fbd2ab7fa Mon Sep 17 00:00:00 2001 From: Stanley Goldman Date: Mon, 13 Nov 2017 15:51:42 -0500 Subject: [PATCH 2/2] Revert "Merge pull request #428 from github-for-unity/fixes/refresh-status-and-log-patch" This reverts commit 85e8d7c304587e69f707ff08dfdeacd747694bde, reversing changes made to e1f42ce949f09fc21bb73a52222c78e03eb2a5a0. --- src/GitHub.Api/Git/IRepository.cs | 3 --- src/GitHub.Api/Git/Repository.cs | 24 ++----------------- src/GitHub.Api/Git/RepositoryManager.cs | 2 -- .../Editor/GitHub.Unity/UI/ChangesView.cs | 2 +- .../Editor/GitHub.Unity/UI/HistoryView.cs | 4 ++-- 5 files changed, 5 insertions(+), 30 deletions(-) diff --git a/src/GitHub.Api/Git/IRepository.cs b/src/GitHub.Api/Git/IRepository.cs index 8ed108a22..7e2d279fa 100644 --- a/src/GitHub.Api/Git/IRepository.cs +++ b/src/GitHub.Api/Git/IRepository.cs @@ -19,9 +19,6 @@ public interface IRepository : IEquatable ITask RequestLock(string file); ITask ReleaseLock(string file, bool force); - void RefreshLog(); - void RefreshStatus(); - void CheckLogChangedEvent(CacheUpdateEvent gitLogCacheUpdateEvent); void CheckStatusChangedEvent(CacheUpdateEvent cacheUpdateEvent); void CheckCurrentBranchChangedEvent(CacheUpdateEvent cacheUpdateEvent); diff --git a/src/GitHub.Api/Git/Repository.cs b/src/GitHub.Api/Git/Repository.cs index daadaacda..f4c3359c9 100644 --- a/src/GitHub.Api/Git/Repository.cs +++ b/src/GitHub.Api/Git/Repository.cs @@ -81,22 +81,12 @@ public ITask SetupRemote(string remote, string remoteUrl) public ITask CommitAllFiles(string message, string body) { - return repositoryManager - .CommitAllFiles(message, body) - .Then(() => { - UpdateGitStatus(); - UpdateGitLog(); - }); + return repositoryManager.CommitAllFiles(message, body); } public ITask CommitFiles(List files, string message, string body) { - return repositoryManager - .CommitFiles(files, message, body) - .Then(() => { - UpdateGitStatus(); - UpdateGitLog(); - }); + return repositoryManager.CommitFiles(files, message, body); } public ITask Pull() @@ -132,16 +122,6 @@ public ITask ReleaseLock(string file, bool force) .Then(UpdateLocks); } - public void RefreshLog() - { - UpdateGitLog(); - } - - public void RefreshStatus() - { - UpdateGitStatus(); - } - public void CheckLogChangedEvent(CacheUpdateEvent cacheUpdateEvent) { var managedCache = cacheContainer.GitLogCache; diff --git a/src/GitHub.Api/Git/RepositoryManager.cs b/src/GitHub.Api/Git/RepositoryManager.cs index fa458c184..6adf29213 100644 --- a/src/GitHub.Api/Git/RepositoryManager.cs +++ b/src/GitHub.Api/Git/RepositoryManager.cs @@ -177,7 +177,6 @@ public ITask CommitAllFiles(string message, string body) add.OnStart += t => IsBusy = true; return add .Then(GitClient.Commit(message, body)) - .Then(UpdateConfigData) .Finally(() => IsBusy = false); } @@ -187,7 +186,6 @@ public ITask CommitFiles(List files, string message, string body) add.OnStart += t => IsBusy = true; return add .Then(GitClient.Commit(message, body)) - .Then(UpdateConfigData) .Finally(() => IsBusy = false); } diff --git a/src/UnityExtension/Assets/Editor/GitHub.Unity/UI/ChangesView.cs b/src/UnityExtension/Assets/Editor/GitHub.Unity/UI/ChangesView.cs index 388ab55fa..3434bd075 100644 --- a/src/UnityExtension/Assets/Editor/GitHub.Unity/UI/ChangesView.cs +++ b/src/UnityExtension/Assets/Editor/GitHub.Unity/UI/ChangesView.cs @@ -43,7 +43,7 @@ public override void OnEnable() if (Repository != null) { Repository.CheckCurrentBranchChangedEvent(lastCurrentBranchChangedEvent); - Repository.RefreshStatus(); + Repository.CheckStatusChangedEvent(lastStatusChangedEvent); } } diff --git a/src/UnityExtension/Assets/Editor/GitHub.Unity/UI/HistoryView.cs b/src/UnityExtension/Assets/Editor/GitHub.Unity/UI/HistoryView.cs index 434e2e79d..b8fc37400 100644 --- a/src/UnityExtension/Assets/Editor/GitHub.Unity/UI/HistoryView.cs +++ b/src/UnityExtension/Assets/Editor/GitHub.Unity/UI/HistoryView.cs @@ -73,8 +73,8 @@ public override void OnEnable() if (Repository != null) { - Repository.RefreshLog(); - Repository.RefreshStatus(); + Repository.CheckLogChangedEvent(lastLogChangedEvent); + Repository.CheckStatusChangedEvent(lastStatusChangedEvent); Repository.CheckCurrentRemoteChangedEvent(lastCurrentRemoteChangedEvent); } }