Skip to content
This repository was archived by the owner on Oct 4, 2021. It is now read-only.

Commit d425bbe

Browse files
committed
Fixes VSTS Bug 1027417: [FATAL] SigTerm signal in
MonoDevelop.VersionControl.Git.dll!MonoDevelop.VersionControl.Git.TaskFailureExtensions::RunWaitAndCapture+0 https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1027417 Not connected to the original bug.
1 parent 1e2564c commit d425bbe

File tree

3 files changed

+33
-22
lines changed

3 files changed

+33
-22
lines changed

main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.StashManagerDialog.cs

-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ protected virtual void Build ()
131131
}
132132
this.DefaultWidth = 575;
133133
this.DefaultHeight = 367;
134-
this.Show ();
135134
this.buttonApplyRemove.Clicked += new global::System.EventHandler (this.OnButtonApplyRemoveClicked);
136135
this.buttonApply.Clicked += new global::System.EventHandler (this.OnButtonApplyClicked);
137136
this.buttonBranch.Clicked += new global::System.EventHandler (this.OnButtonBranchClicked);

main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitService.cs

+8-2
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,14 @@ public static void ShowMergeDialog (GitRepository repo, bool rebasing)
124124

125125
public static void ShowStashManager (GitRepository repo)
126126
{
127-
using (var dlg = new StashManagerDialog (repo))
128-
MessageService.ShowCustomDialog (dlg);
127+
var dlg = new StashManagerDialog ();
128+
Task.Run (async delegate {
129+
await dlg.InitializeAsync (repo);
130+
await Runtime.RunInMainThread (delegate {
131+
MessageService.ShowCustomDialog (dlg);
132+
dlg.Dispose ();
133+
});
134+
});
129135
}
130136

131137
public static async Task<bool> SwitchToBranchAsync (GitRepository repo, string branch)

main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/StashManagerDialog.cs

+25-19
Original file line numberDiff line numberDiff line change
@@ -29,38 +29,44 @@
2929
using MonoDevelop.Ide;
3030
using LibGit2Sharp;
3131
using System.Threading.Tasks;
32+
using System.Threading;
3233

3334
namespace MonoDevelop.VersionControl.Git
3435
{
3536
partial class StashManagerDialog : Gtk.Dialog
3637
{
37-
readonly GitRepository repository;
38-
readonly ListStore store;
39-
readonly StashCollection stashes;
38+
GitRepository repository;
39+
ListStore store;
40+
StashCollection stashes;
4041

41-
public StashManagerDialog (GitRepository repo)
42+
public StashManagerDialog ()
4243
{
4344
this.Build ();
4445
this.UseNativeContextMenus ();
45-
repository = repo;
46-
47-
stashes = repo.GetStashes ();
46+
}
4847

49-
store = new ListStore (typeof(Stash), typeof(string), typeof(string));
50-
list.Model = store;
51-
list.SearchColumn = -1; // disable the interactive search
48+
public async Task InitializeAsync(GitRepository repo, CancellationToken cancellationToken = default)
49+
{
50+
repository = repo;
51+
stashes = await repo.GetStashesAsync (cancellationToken);
5252

53-
list.AppendColumn (GettextCatalog.GetString ("Date/Time"), new CellRendererText (), "text", 1);
54-
list.AppendColumn (GettextCatalog.GetString ("Comment"), new CellRendererText (), "text", 2);
55-
Fill ();
56-
TreeIter it;
57-
if (store.GetIterFirst (out it))
58-
list.Selection.SelectIter (it);
59-
UpdateButtons ();
53+
await Runtime.RunInMainThread (delegate {
54+
store = new ListStore (typeof (Stash), typeof (string), typeof (string));
55+
list.Model = store;
56+
list.SearchColumn = -1; // disable the interactive search
6057

61-
list.Selection.Changed += delegate {
58+
list.AppendColumn (GettextCatalog.GetString ("Date/Time"), new CellRendererText (), "text", 1);
59+
list.AppendColumn (GettextCatalog.GetString ("Comment"), new CellRendererText (), "text", 2);
60+
Fill ();
61+
TreeIter it;
62+
if (store.GetIterFirst (out it))
63+
list.Selection.SelectIter (it);
6264
UpdateButtons ();
63-
};
65+
66+
list.Selection.Changed += delegate {
67+
UpdateButtons ();
68+
};
69+
});
6470
}
6571

6672
void Fill ()

0 commit comments

Comments
 (0)