From 5fdd4e3189500f9bca1a91756ecec932c068c3b0 Mon Sep 17 00:00:00 2001 From: leo Date: Tue, 17 Mar 2026 10:49:43 +0800 Subject: [PATCH] enhance: manually update local branch tree after checking out and fast-forward a exiting local branch (#2169) Signed-off-by: leo --- src/ViewModels/CheckoutAndFastForward.cs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/ViewModels/CheckoutAndFastForward.cs b/src/ViewModels/CheckoutAndFastForward.cs index 197701c3..1b2ef381 100644 --- a/src/ViewModels/CheckoutAndFastForward.cs +++ b/src/ViewModels/CheckoutAndFastForward.cs @@ -80,17 +80,19 @@ namespace SourceGit.ViewModels await new Commands.Stash(_repo.FullPath) .Use(log) .PopAsync("stash@{0}"); + + LocalBranch.Behind.Clear(); + LocalBranch.Head = RemoteBranch.Head; + LocalBranch.CommitterDate = RemoteBranch.CommitterDate; + + _repo.FastRefreshBranchesAfterCheckout(LocalBranch); + } + else + { + _repo.MarkWorkingCopyDirtyManually(); } log.Complete(); - - if (_repo.HistoryFilterMode == Models.FilterMode.Included) - _repo.SetBranchFilterMode(LocalBranch, Models.FilterMode.Included, false, false); - - _repo.MarkBranchesDirtyManually(); - - ProgressDescription = "Waiting for branch updated..."; - await Task.Delay(400); return succ; }