From 1c9a81274540afc0c304a5c44bf793024bc50e1c Mon Sep 17 00:00:00 2001 From: Nathan Baulch Date: Fri, 13 Jun 2025 21:12:34 +1000 Subject: [PATCH] exactly match behavior of left sidebar --- src/ViewModels/Histories.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/ViewModels/Histories.cs b/src/ViewModels/Histories.cs index 04c76234..68703521 100644 --- a/src/ViewModels/Histories.cs +++ b/src/ViewModels/Histories.cs @@ -237,18 +237,18 @@ namespace SourceGit.ViewModels { if (localBranch.IsCurrent) return; - if (localBranch.TrackStatus.Behind.Count == 0) - _repo.CheckoutBranch(localBranch); - else if (localBranch.TrackStatus.Ahead.Count == 0) + if (localBranch.TrackStatus.Ahead.Count > 0) + { + if (_repo.CanCreatePopup()) + _repo.ShowPopup(new CreateBranch(_repo, remoteBranch)); + } + else if (localBranch.TrackStatus.Behind.Count > 0) { if (_repo.CanCreatePopup()) _repo.ShowPopup(new CheckoutAndFastForward(_repo, localBranch, remoteBranch)); } else - { - if (_repo.CanCreatePopup()) - _repo.ShowPopup(new CreateBranch(_repo, remoteBranch)); - } + _repo.CheckoutBranch(localBranch); return; } }