private void ResetSelectedLinesToolStripMenuItemClick(object sender, EventArgs e) { if (MessageBox.Show(_resetSelectedLinesConfirmation.Text, _resetChangesCaption.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) { return; } // Prepare git command string args = "apply --whitespace=nowarn --reverse"; if (_currentItemStaged) //staged { args += " --index"; } string patch = PatchManager.GetSelectedLinesAsPatch(SelectedDiff.GetText(), SelectedDiff.GetSelectionPosition(), SelectedDiff.GetSelectionLength(), true); if (!string.IsNullOrEmpty(patch)) { GitCommandHelpers.RunCmd(Settings.GitCommand, args, patch); ScanClick(null, null); } }
private void StageSelectedLinesToolStripMenuItemClick(object sender, EventArgs e) { // Prepare git command string args = "apply --cached --whitespace=nowarn"; if (_currentItemStaged) //staged { args += " --reverse"; } string patch = PatchManager.GetSelectedLinesAsPatch(SelectedDiff.GetText(), SelectedDiff.GetSelectionPosition(), SelectedDiff.GetSelectionLength(), _currentItemStaged); if (!string.IsNullOrEmpty(patch)) { GitCommandHelpers.RunCmd(Settings.GitCommand, args, patch); ScanClick(null, null); } }