diff options
Diffstat (limited to 'main')
-rw-r--r-- | main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/Commands.cs | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/Commands.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/Commands.cs index 0214f9e5b6..12caa65e1d 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/Commands.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/Commands.cs @@ -97,7 +97,7 @@ namespace MonoDevelop.VersionControl.Git await GitService.SwitchToBranchAsync (Repository, (string)dataItem).ConfigureAwait (false); } - protected override void Update (CommandArrayInfo info) + protected override async Task UpdateAsync (CommandArrayInfo info, CancellationToken cancelToken) { var repo = Repository; if (repo == null) @@ -109,13 +109,10 @@ namespace MonoDevelop.VersionControl.Git if (((wob is WorkspaceItem) && ((WorkspaceItem)wob).ParentWorkspace == null) || (wob.BaseDirectory.CanonicalPath == repo.RootPath.CanonicalPath)) { - string currentBranch = GitRepository.DefaultNoBranchName; - var getBranch = repo.GetCurrentBranchAsync (); - if (getBranch.Wait (250)) - currentBranch = getBranch.Result; + var currentBranch = await repo.GetCurrentBranchAsync (cancelToken); - foreach (var branch in repo.GetLocalBranchNamesAsync ().Result) { - CommandInfo ci = info.Add (branch, branch); + foreach (var branch in await repo.GetLocalBranchNamesAsync (cancelToken)) { + var ci = info.Add (branch, branch); if (branch == currentBranch) ci.Checked = true; } |