Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/GitHub.Api/Git/IRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public interface IRepository : IEquatable<IRepository>

void RefreshLog();
void RefreshStatus();

void UpdateConfigData();
void CheckLogChangedEvent(CacheUpdateEvent gitLogCacheUpdateEvent);
void CheckStatusChangedEvent(CacheUpdateEvent cacheUpdateEvent);
void CheckCurrentBranchChangedEvent(CacheUpdateEvent cacheUpdateEvent);
Expand Down
5 changes: 5 additions & 0 deletions src/GitHub.Api/Git/Repository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,11 @@ public void RefreshStatus()
UpdateGitStatus();
}

public void UpdateConfigData()
{
repositoryManager?.UpdateConfigData();
}

public void CheckLogChangedEvent(CacheUpdateEvent cacheUpdateEvent)
{
var managedCache = cacheContainer.GitLogCache;
Expand Down
8 changes: 6 additions & 2 deletions src/GitHub.Api/Git/RepositoryManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public interface IRepositoryManager : IDisposable
ITask LockFile(string file);
ITask UnlockFile(string file, bool force);
int WaitForEvents();
void UpdateConfigData();

IGitConfig Config { get; }
IGitClient GitClient { get; }
Expand Down Expand Up @@ -177,7 +178,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);
}

Expand All @@ -187,7 +187,6 @@ public ITask CommitFiles(List<string> files, string message, string body)
add.OnStart += t => IsBusy = true;
return add
.Then(GitClient.Commit(message, body))
.Then(UpdateConfigData)
.Finally(() => IsBusy = false);
}

Expand Down Expand Up @@ -298,6 +297,11 @@ public ITask UnlockFile(string file, bool force)
return HookupHandlers(task);
}

public void UpdateConfigData()
{
UpdateConfigData(false);
}

private void LoadGitUser()
{
GitClient.GetConfigUserAndEmail()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ public override void OnEnable()
if (Repository != null)
{
Repository.CheckLocalAndRemoteBranchListChangedEvent(lastLocalAndRemoteBranchListChangedEvent);
Repository.UpdateConfigData();
}
}

Expand Down