diff --git a/src/GitHub.Api/Git/IRepository.cs b/src/GitHub.Api/Git/IRepository.cs index 7e2d279fa..8ed108a22 100644 --- a/src/GitHub.Api/Git/IRepository.cs +++ b/src/GitHub.Api/Git/IRepository.cs @@ -19,6 +19,9 @@ 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 f4c3359c9..daadaacda 100644 --- a/src/GitHub.Api/Git/Repository.cs +++ b/src/GitHub.Api/Git/Repository.cs @@ -81,12 +81,22 @@ public ITask SetupRemote(string remote, string remoteUrl) public ITask CommitAllFiles(string message, string body) { - return repositoryManager.CommitAllFiles(message, body); + return repositoryManager + .CommitAllFiles(message, body) + .Then(() => { + UpdateGitStatus(); + UpdateGitLog(); + }); } public ITask CommitFiles(List files, string message, string body) { - return repositoryManager.CommitFiles(files, message, body); + return repositoryManager + .CommitFiles(files, message, body) + .Then(() => { + UpdateGitStatus(); + UpdateGitLog(); + }); } public ITask Pull() @@ -122,6 +132,16 @@ 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 6adf29213..fa458c184 100644 --- a/src/GitHub.Api/Git/RepositoryManager.cs +++ b/src/GitHub.Api/Git/RepositoryManager.cs @@ -177,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); } @@ -186,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); } diff --git a/src/UnityExtension/Assets/Editor/GitHub.Unity/UI/ChangesView.cs b/src/UnityExtension/Assets/Editor/GitHub.Unity/UI/ChangesView.cs index 3434bd075..388ab55fa 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.CheckStatusChangedEvent(lastStatusChangedEvent); + Repository.RefreshStatus(); } } diff --git a/src/UnityExtension/Assets/Editor/GitHub.Unity/UI/HistoryView.cs b/src/UnityExtension/Assets/Editor/GitHub.Unity/UI/HistoryView.cs index b8fc37400..434e2e79d 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.CheckLogChangedEvent(lastLogChangedEvent); - Repository.CheckStatusChangedEvent(lastStatusChangedEvent); + Repository.RefreshLog(); + Repository.RefreshStatus(); Repository.CheckCurrentRemoteChangedEvent(lastCurrentRemoteChangedEvent); } }