Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit 06d801a

Browse files
Merge branch 'enhancements/using-cache-invalidated-events' into enhancements/git-client-cache
# Conflicts: # src/GitHub.Api/Git/RepositoryManager.cs
2 parents 90f1db4 + fd4a538 commit 06d801a

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

src/GitHub.Api/Git/IRepository.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public interface IRepository : IEquatable<IRepository>
2121

2222
void RefreshLog();
2323
void RefreshStatus();
24-
24+
void UpdateConfigData();
2525
void CheckLogChangedEvent(CacheUpdateEvent gitLogCacheUpdateEvent);
2626
void CheckStatusChangedEvent(CacheUpdateEvent cacheUpdateEvent);
2727
void CheckCurrentBranchChangedEvent(CacheUpdateEvent cacheUpdateEvent);

src/GitHub.Api/Git/Repository.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,11 @@ public void RefreshStatus()
135135
UpdateGitStatus();
136136
}
137137

138+
public void UpdateConfigData()
139+
{
140+
repositoryManager?.UpdateConfigData();
141+
}
142+
138143
public void CheckLogChangedEvent(CacheUpdateEvent cacheUpdateEvent)
139144
{
140145
var managedCache = cacheContainer.GitLogCache;

src/GitHub.Api/Git/RepositoryManager.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public interface IRepositoryManager : IDisposable
3939
ITask LockFile(string file);
4040
ITask UnlockFile(string file, bool force);
4141
int WaitForEvents();
42+
void UpdateConfigData();
4243

4344
IGitConfig Config { get; }
4445
IGitClient GitClient { get; }
@@ -174,7 +175,6 @@ public ITask CommitAllFiles(string message, string body)
174175
add.OnStart += t => IsBusy = true;
175176
return add
176177
.Then(GitClient.Commit(message, body))
177-
.Then(UpdateConfigData)
178178
.Finally(() => IsBusy = false);
179179
}
180180

@@ -184,7 +184,6 @@ public ITask CommitFiles(List<string> files, string message, string body)
184184
add.OnStart += t => IsBusy = true;
185185
return add
186186
.Then(GitClient.Commit(message, body))
187-
.Then(UpdateConfigData)
188187
.Finally(() => IsBusy = false);
189188
}
190189

@@ -295,6 +294,11 @@ public ITask UnlockFile(string file, bool force)
295294
return HookupHandlers(task);
296295
}
297296

297+
public void UpdateConfigData()
298+
{
299+
UpdateConfigData(false);
300+
}
301+
298302
private void SetupWatcher()
299303
{
300304
watcher.HeadChanged += Watcher_OnHeadChanged;

src/UnityExtension/Assets/Editor/GitHub.Unity/UI/BranchesView.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ public override void OnEnable()
6868
if (Repository != null)
6969
{
7070
Repository.CheckLocalAndRemoteBranchListChangedEvent(lastLocalAndRemoteBranchListChangedEvent);
71+
Repository.UpdateConfigData();
7172
}
7273
}
7374

0 commit comments

Comments
 (0)