diff --git a/src/ViewModels/Repository.cs b/src/ViewModels/Repository.cs index c347a10a..3c1432f4 100644 --- a/src/ViewModels/Repository.cs +++ b/src/ViewModels/Repository.cs @@ -1866,21 +1866,6 @@ namespace SourceGit.ViewModels }; menu.Items.Add(fastForward); - var selectedCommit = (_histories?.DetailContext as CommitDetail)?.Commit; - if (selectedCommit != null && !selectedCommit.SHA.Equals(branch.Head, StringComparison.Ordinal)) - { - var move = new MenuItem(); - move.Header = App.Text("BranchCM.ResetToSelectedCommit", branch.Name, selectedCommit.SHA.Substring(0, 10)); - move.Icon = App.CreateMenuIcon("Icons.Reset"); - move.Click += (_, e) => - { - if (CanCreatePopup()) - ShowPopup(new ResetWithoutCheckout(this, branch, selectedCommit)); - e.Handled = true; - }; - menu.Items.Add(move); - } - var fetchInto = new MenuItem(); fetchInto.Header = App.Text("BranchCM.FetchInto", upstream.FriendlyName, branch.Name); fetchInto.Icon = App.CreateMenuIcon("Icons.Fetch"); @@ -1924,6 +1909,25 @@ namespace SourceGit.ViewModels menu.Items.Add(rebase); } + if (worktree == null) + { + var selectedCommit = (_histories?.DetailContext as CommitDetail)?.Commit; + if (selectedCommit != null && !selectedCommit.SHA.Equals(branch.Head, StringComparison.Ordinal)) + { + var move = new MenuItem(); + move.Header = App.Text("BranchCM.ResetToSelectedCommit", branch.Name, selectedCommit.SHA.Substring(0, 10)); + move.Icon = App.CreateMenuIcon("Icons.Reset"); + move.Click += (_, e) => + { + if (CanCreatePopup()) + ShowPopup(new ResetWithoutCheckout(this, branch, selectedCommit)); + e.Handled = true; + }; + menu.Items.Add(new MenuItem() { Header = "-" }); + menu.Items.Add(move); + } + } + var compareWithHead = new MenuItem(); compareWithHead.Header = App.Text("BranchCM.CompareWithHead"); compareWithHead.Icon = App.CreateMenuIcon("Icons.Compare");