code_style: simplify static commands used by styles and main menu; run dotnet format

This commit is contained in:
leo 2024-09-02 20:27:12 +08:00
parent e27d2d6a3f
commit 998230edff
No known key found for this signature in database
10 changed files with 35 additions and 52 deletions

View file

@ -262,7 +262,7 @@ namespace SourceGit.ViewModels
Task.Run(() => Commands.MergeTool.OpenForDiff(_repo.FullPath, toolType, toolPath, opt));
ev.Handled = true;
};
var fullPath = Path.Combine(_repo.FullPath, change.Path);
var explore = new MenuItem();
explore.Header = App.Text("RevealFile");
@ -320,11 +320,11 @@ namespace SourceGit.ViewModels
{
if (change.Index == Models.ChangeState.Renamed)
new Commands.Checkout(_repo.FullPath).FileWithRevision(change.OriginalPath, $"{_commit.SHA}~1");
new Commands.Checkout(_repo.FullPath).FileWithRevision(change.Path, $"{_commit.SHA}~1");
ev.Handled = true;
};
menu.Items.Add(resetToThisRevision);
menu.Items.Add(resetToFirstParent);
menu.Items.Add(new MenuItem { Header = "-" });
@ -413,7 +413,7 @@ namespace SourceGit.ViewModels
window.Show();
ev.Handled = true;
};
var resetToThisRevision = new MenuItem();
resetToThisRevision.Header = App.Text("ChangeCM.CheckoutThisRevision");
resetToThisRevision.Icon = App.CreateMenuIcon("Icons.File.Checkout");