internal void AmendCommit() { const string amendMsg = @"You are about to amend a commit that has tags or remotes, which could cause issues in local and remote repositories. Are you sure you want to continue?"; if (string.IsNullOrWhiteSpace(Comments)) { Comments = tracker.LastCommitMessage; return; } else { if (tracker.CurrentCommitHasRefs() && MessageBox.Show(amendMsg, "Amend Last Commit", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.No) { return; } var dte = BasicSccProvider.GetServiceEx <EnvDTE.DTE>(); if (dte.ItemOperations.PromptToSave == EnvDTE.vsPromptResult.vsPromptResultCancelled) { return; } using (service.DisableRefresh()) { StageSelectedFiles(false); try { ShowStatusMessage("Amending last Commit ..."); var id = tracker.Commit(Comments, true, chkSignOff.IsChecked == true); ShowStatusMessage("Amend last commit successfully. Commit Hash: " + id); ClearUI(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Exclamation); ShowStatusMessage(ex.Message); } } service.MarkDirty(false); } }