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

Commit

Permalink
Fixes VSTS Bug 1027417: [FATAL] SigTerm signal in
Browse files Browse the repository at this point in the history
MonoDevelop.VersionControl.Git.dll!MonoDevelop.VersionControl.Git.TaskFailureExtensions::RunWaitAndCapture+0

https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1027417

Not connected to the original bug.
  • Loading branch information
mkrueger committed Jan 22, 2020
1 parent 1e2564c commit 564c0e0
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ protected virtual void Build ()
}
this.DefaultWidth = 575;
this.DefaultHeight = 367;
this.Show ();
this.buttonApplyRemove.Clicked += new global::System.EventHandler (this.OnButtonApplyRemoveClicked);
this.buttonApply.Clicked += new global::System.EventHandler (this.OnButtonApplyClicked);
this.buttonBranch.Clicked += new global::System.EventHandler (this.OnButtonBranchClicked);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,16 @@ protected override async Task UpdateAsync (CommandInfo info, CancellationToken c

class ManageStashesHandler: GitCommandHandler
{
protected override void Run ()
protected override async void Run ()
{
GitService.ShowStashManager (Repository);
try {
var dlg = new StashManagerDialog ();
await dlg.InitializeAsync (Repository);
MessageService.ShowCustomDialog (dlg);
dlg.Dispose ();
} catch (Exception e) {
LoggingService.LogInternalError (e);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,6 @@ public static void ShowMergeDialog (GitRepository repo, bool rebasing)
}
}

public static void ShowStashManager (GitRepository repo)
{
using (var dlg = new StashManagerDialog (repo))
MessageService.ShowCustomDialog (dlg);
}

public static async Task<bool> SwitchToBranchAsync (GitRepository repo, string branch)
{
var monitor = new MessageDialogProgressMonitor (true, false, false, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,38 +29,44 @@
using MonoDevelop.Ide;
using LibGit2Sharp;
using System.Threading.Tasks;
using System.Threading;

namespace MonoDevelop.VersionControl.Git
{
partial class StashManagerDialog : Gtk.Dialog
{
readonly GitRepository repository;
readonly ListStore store;
readonly StashCollection stashes;
GitRepository repository;
ListStore store;
StashCollection stashes;

public StashManagerDialog (GitRepository repo)
public StashManagerDialog ()
{
this.Build ();
this.UseNativeContextMenus ();
repository = repo;

stashes = repo.GetStashes ();
}

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

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

list.Selection.Changed += delegate {
list.AppendColumn (GettextCatalog.GetString ("Date/Time"), new CellRendererText (), "text", 1);
list.AppendColumn (GettextCatalog.GetString ("Comment"), new CellRendererText (), "text", 2);
Fill ();
TreeIter it;
if (store.GetIterFirst (out it))
list.Selection.SelectIter (it);
UpdateButtons ();
};

list.Selection.Changed += delegate {
UpdateButtons ();
};
});
}

void Fill ()
Expand Down

0 comments on commit 564c0e0

Please sign in to comment.