From ee8efa5c4771a2ab6e197012de3900da52f867c6 Mon Sep 17 00:00:00 2001 From: leo Date: Thu, 29 Apr 2021 21:40:15 +0800 Subject: [PATCH] fix: fix wrong context menu items for current branch --- src/Views/Widgets/Histories.xaml.cs | 56 ++++++++++++++--------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/src/Views/Widgets/Histories.xaml.cs b/src/Views/Widgets/Histories.xaml.cs index 78446747..205543ef 100644 --- a/src/Views/Widgets/Histories.xaml.cs +++ b/src/Views/Widgets/Histories.xaml.cs @@ -285,36 +285,36 @@ namespace SourceGit.Views.Widgets { e.Handled = true; }; menu.Items.Add(reset); - - if (!merged) { - var rebase = new MenuItem(); - rebase.Header = App.Text("CommitCM.Rebase", current.Name); - rebase.Click += (o, e) => { - new Popups.Rebase(repo.Path, current.Name, commit).Show(); - e.Handled = true; - }; - menu.Items.Add(rebase); - - var cherryPick = new MenuItem(); - cherryPick.Header = App.Text("CommitCM.CherryPick"); - cherryPick.Click += (o, e) => { - new Popups.CherryPick(repo.Path, commit).Show(); - e.Handled = true; - }; - menu.Items.Add(cherryPick); - } else { - var revert = new MenuItem(); - revert.Header = App.Text("CommitCM.Revert"); - revert.Click += (o, e) => { - new Popups.Revert(repo.Path, commit).Show(); - e.Handled = true; - }; - menu.Items.Add(revert); - } - - menu.Items.Add(new Separator()); } + if (!merged) { + var rebase = new MenuItem(); + rebase.Header = App.Text("CommitCM.Rebase", current.Name); + rebase.Click += (o, e) => { + new Popups.Rebase(repo.Path, current.Name, commit).Show(); + e.Handled = true; + }; + menu.Items.Add(rebase); + + var cherryPick = new MenuItem(); + cherryPick.Header = App.Text("CommitCM.CherryPick"); + cherryPick.Click += (o, e) => { + new Popups.CherryPick(repo.Path, commit).Show(); + e.Handled = true; + }; + menu.Items.Add(cherryPick); + } else { + var revert = new MenuItem(); + revert.Header = App.Text("CommitCM.Revert"); + revert.Click += (o, e) => { + new Popups.Revert(repo.Path, commit).Show(); + e.Handled = true; + }; + menu.Items.Add(revert); + } + + menu.Items.Add(new Separator()); + var createBranch = new MenuItem(); createBranch.Header = App.Text("CreateBranch"); createBranch.Click += (o, e) => {