protected async void OnButtonBranchClicked(object sender, System.EventArgs e)
        {
            Stash s          = GetSelected();
            int   stashIndex = GetSelectedIndex();

            if (s != null)
            {
                var dlg = new EditBranchDialog(repository);
                try {
                    if (MessageService.RunCustomDialog(dlg) == (int)ResponseType.Ok)
                    {
                        await repository.CreateBranchFromCommitAsync(dlg.BranchName, s.Base);

                        if (await GitService.SwitchToBranchAsync(repository, dlg.BranchName))
                        {
                            await ApplyStashAndRemove(stashIndex);
                        }
                    }
                } finally {
                    dlg.Destroy();
                    dlg.Dispose();
                }
                Respond(ResponseType.Ok);
            }
        }
Exemple #2
0
        protected virtual async void OnButtonSetDefaultBranchClicked(object sender, EventArgs e)
        {
            TreeIter it;

            if (!listBranches.Selection.GetSelected(out it))
            {
                return;
            }
            var b = (Branch)storeBranches.GetValue(it, 0);

            if (await GitService.SwitchToBranchAsync(repo, b.FriendlyName))
            {
                FillBranches();
            }
        }
        protected virtual async void OnButtonSetDefaultBranchClicked(object sender, EventArgs e)
        {
            TreeIter it;

            if (!listBranches.Selection.GetSelected(out it))
            {
                return;
            }
            var b     = (Branch)storeBranches.GetValue(it, 0);
            var token = destroyTokenSource.Token;

            if (await GitService.SwitchToBranchAsync(repo, b.FriendlyName) && !token.IsCancellationRequested)
            {
                FillBranches();
            }
        }
Exemple #4
0
 protected async override void Run(object dataItem)
 {
     await GitService.SwitchToBranchAsync(Repository, (string)dataItem).ConfigureAwait(false);
 }