diff options
author | Mike Krüger <mikkrg@microsoft.com> | 2019-12-05 10:32:06 +0300 |
---|---|---|
committer | monojenkins <jo.shields+jenkins@xamarin.com> | 2019-12-05 12:53:06 +0300 |
commit | 6149bae2cfd23b004dca6844077b9080510cde64 (patch) | |
tree | 93c6c931aeb63572a63892ff6484c743ec5ae112 | |
parent | a31b5aec6029543cf485bd0f577a8b6023e1603f (diff) |
Fixes VSTS Bug 1030370: [FATAL] SigTerm signal in MonoDevelop.VersionControl.Git.dll!MonoDevelop.VersionControl.Git.SwitchToBranchHandler::Update+98
https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1030370
-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; } |