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

Commit 564c0e0

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 564c0e0

File tree

4 files changed

+34
-28
lines changed

4 files changed

+34
-28
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/Commands.cs

+9-2
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,16 @@ protected override async Task UpdateAsync (CommandInfo info, CancellationToken c
225225

226226
class ManageStashesHandler: GitCommandHandler
227227
{
228-
protected override void Run ()
228+
protected override async void Run ()
229229
{
230-
GitService.ShowStashManager (Repository);
230+
try {
231+
var dlg = new StashManagerDialog ();
232+
await dlg.InitializeAsync (Repository);
233+
MessageService.ShowCustomDialog (dlg);
234+
dlg.Dispose ();
235+
} catch (Exception e) {
236+
LoggingService.LogInternalError (e);
237+
}
231238
}
232239
}
233240
}

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

-6
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,6 @@ public static void ShowMergeDialog (GitRepository repo, bool rebasing)
122122
}
123123
}
124124

125-
public static void ShowStashManager (GitRepository repo)
126-
{
127-
using (var dlg = new StashManagerDialog (repo))
128-
MessageService.ShowCustomDialog (dlg);
129-
}
130-
131125
public static async Task<bool> SwitchToBranchAsync (GitRepository repo, string branch)
132126
{
133127
var monitor = new MessageDialogProgressMonitor (true, false, false, true);

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)