Skip to content

Commit a5e783d

Browse files
committed
enhance: disable Fast-Forward for worktree which is not current branch
1 parent 3b1a54d commit a5e783d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/ViewModels/Repository.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1355,8 +1355,9 @@ public ContextMenu CreateContextMenuForLocalBranch(Models.Branch branch)
13551355
};
13561356
menu.Items.Add(checkout);
13571357

1358+
var worktree = _worktrees.Find(x => x.Branch == branch.FullName);
13581359
var upstream = _branches.Find(x => x.FullName == branch.Upstream);
1359-
if (upstream != null)
1360+
if (upstream != null && worktree == null)
13601361
{
13611362
var fastForward = new MenuItem();
13621363
fastForward.Header = new Views.NameHighlightedTextBlock("BranchCM.FastForward", upstream.FriendlyName);

0 commit comments

Comments
 (0)