private void createABranchOnThisCommitToolStripMenuItem_Click(object sender, EventArgs e) { if (gridReflog.SelectedCells.Count == 0 && gridReflog.SelectedRows.Count == 0) { return; } UICommands.DoActionOnRepo(() => { using (var form = new FormCreateBranch(UICommands, GetShaOfRefLine())) { form.CheckoutAfterCreation = false; form.UserAbleToChangeRevision = false; form.CouldBeOrphan = false; return(form.ShowDialog(this) == DialogResult.OK); } }); }
private void resetCurrentBranchOnThisCommitToolStripMenuItem_Click(object sender, EventArgs e) { if (_isDirtyDir) { if (MessageBox.Show(this, _continueResetCurrentBranchEvenWithChangesText.Text, _continueResetCurrentBranchCaptionText.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No) { return; } } var gitRevision = UICommands.Module.GetRevision(GetShaOfRefLine()); var resetType = _isDirtyDir ? FormResetCurrentBranch.ResetType.Soft : FormResetCurrentBranch.ResetType.Hard; UICommands.DoActionOnRepo(() => { using (var form = new FormResetCurrentBranch(UICommands, gitRevision, resetType)) { return(form.ShowDialog(this) == DialogResult.OK); } }); }