diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml index cb491133c..e21015b09 100644 --- a/src/Resources/Locales/en_US.axaml +++ b/src/Resources/Locales/en_US.axaml @@ -999,11 +999,13 @@ Clear History Are you sure you want to clear all commit message history? This action cannot be undone. COMMIT + COMMIT & FORCE PUSH COMMIT & PUSH Template/History Trigger click event Commit (Edit) Stage all changes and commit + This operation will amend the last commit and force push it to the remote branch. The remote branch history will be rewritten. Do you want to continue? You are creating commit on a detached HEAD. Do you want to continue? You have staged {0} file(s) but only {1} file(s) displayed ({2} files are filtered out). Do you want to continue? CONFLICTS DETECTED diff --git a/src/Views/WorkingCopy.axaml b/src/Views/WorkingCopy.axaml index fc1127053..c22175751 100644 --- a/src/Views/WorkingCopy.axaml +++ b/src/Views/WorkingCopy.axaml @@ -418,32 +418,95 @@ - + + + + + + + + + diff --git a/src/Views/WorkingCopy.axaml.cs b/src/Views/WorkingCopy.axaml.cs index 47b9ae75f..2c4c74222 100644 --- a/src/Views/WorkingCopy.axaml.cs +++ b/src/Views/WorkingCopy.axaml.cs @@ -296,6 +296,17 @@ private async void OnCommitWithPush(object _, RoutedEventArgs e) e.Handled = true; } + private async void OnCommitWithForcePush(object _, RoutedEventArgs e) + { + if (App.GetLauncher() is { CommandPalette: { } } launcher) + return; + + if (DataContext is ViewModels.WorkingCopy vm) + await vm.CommitAsync(false, false, true); + + e.Handled = true; + } + private ContextMenu CreateContextMenuForUnstagedChanges(ViewModels.WorkingCopy vm, string selectedSingleFolder) { var repo = vm.Repository;