mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-24 05:35:00 +00:00
feature<Fast-Forward>: allow fast-forward on local branch that not checked out.
This commit is contained in:
parent
12511007e3
commit
9d6ac9c449
4 changed files with 88 additions and 1 deletions
|
@ -654,7 +654,7 @@ namespace SourceGit.Views.Widgets {
|
|||
var upstream = branch.Upstream.Substring(13);
|
||||
var fastForward = new MenuItem();
|
||||
fastForward.Header = App.Text("BranchCM.FastForward", upstream);
|
||||
fastForward.IsEnabled = !string.IsNullOrEmpty(branch.UpstreamTrackStatus);
|
||||
fastForward.IsEnabled = !string.IsNullOrEmpty(branch.UpstreamTrackStatus) && branch.UpstreamTrackStatus.IndexOf('↑') < 0;
|
||||
fastForward.Click += (o, e) => {
|
||||
new Popups.Merge(repo.Path, upstream, branch.Name).ShowAndStart();
|
||||
e.Handled = true;
|
||||
|
@ -683,6 +683,21 @@ namespace SourceGit.Views.Widgets {
|
|||
e.Handled = true;
|
||||
};
|
||||
menu.Items.Add(checkout);
|
||||
|
||||
if (!string.IsNullOrEmpty(branch.Upstream)) {
|
||||
var upstream = branch.Upstream.Substring(13);
|
||||
var fastForward = new MenuItem();
|
||||
fastForward.Header = App.Text("BranchCM.FastForward", upstream);
|
||||
fastForward.IsEnabled = !string.IsNullOrEmpty(branch.UpstreamTrackStatus) && branch.UpstreamTrackStatus.IndexOf('↑') < 0;
|
||||
fastForward.Click += (o, e) => {
|
||||
new Popups.FastForwardWithoutCheckout(repo.Path, branch.Name, upstream).ShowAndStart();
|
||||
e.Handled = true;
|
||||
};
|
||||
|
||||
menu.Items.Add(new Separator());
|
||||
menu.Items.Add(fastForward);
|
||||
}
|
||||
|
||||
menu.Items.Add(new Separator());
|
||||
menu.Items.Add(push);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue