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
3 changes: 3 additions & 0 deletions src/GitHub.Api/Git/IRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ public interface IRepository : IEquatable<IRepository>
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);
Expand Down
24 changes: 22 additions & 2 deletions src/GitHub.Api/Git/Repository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<string> files, string message, string body)
{
return repositoryManager.CommitFiles(files, message, body);
return repositoryManager
.CommitFiles(files, message, body)
.Then(() => {
UpdateGitStatus();
UpdateGitLog();
});
}

public ITask Pull()
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions src/GitHub.Api/Git/RepositoryManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -186,6 +187,7 @@ 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
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public override void OnEnable()
if (Repository != null)
{
Repository.CheckCurrentBranchChangedEvent(lastCurrentBranchChangedEvent);
Repository.CheckStatusChangedEvent(lastStatusChangedEvent);
Repository.RefreshStatus();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ public override void OnEnable()

if (Repository != null)
{
Repository.CheckLogChangedEvent(lastLogChangedEvent);
Repository.CheckStatusChangedEvent(lastStatusChangedEvent);
Repository.RefreshLog();
Repository.RefreshStatus();
Repository.CheckCurrentRemoteChangedEvent(lastCurrentRemoteChangedEvent);
}
}
Expand Down