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

Commit

Permalink
Merge branch 'fixes/refresh-status-and-log-patch' into releases/0.22
Browse files Browse the repository at this point in the history
  • Loading branch information
StanleyGoldman committed Nov 13, 2017
2 parents 85e8d7c + 115f77f commit fd2446f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
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

0 comments on commit fd2446f

Please sign in to comment.