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

Fixes VSTS Bug 1027417: [FATAL] SigTerm signal in #9543

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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