enhance: only create squash menu item if it is needed
Some checks failed
Continuous Integration / Package (push) Blocked by required conditions
Continuous Integration / Build (push) Waiting to run
Continuous Integration / Prepare version string (push) Waiting to run
Localization Check / localization-check (push) Has been cancelled

This commit is contained in:
leo 2024-12-13 16:24:39 +08:00
parent 24b6153226
commit 0a0e2bc044
No known key found for this signature in database

View file

@ -407,10 +407,11 @@ namespace SourceGit.ViewModels
};
menu.Items.Add(reset);
if (commit.IsMerged)
{
var squash = new MenuItem();
squash.Header = App.Text("CommitCM.SquashCommitsSinceThis");
squash.Icon = App.CreateMenuIcon("Icons.SquashIntoParent");
squash.IsVisible = commit.IsMerged;
squash.Click += (_, e) =>
{
if (_repo.LocalChangesCount > 0)
@ -426,6 +427,7 @@ namespace SourceGit.ViewModels
};
menu.Items.Add(squash);
}
}
else
{
var reword = new MenuItem();