Skip to content

Commit 5fdd4e3

Browse files
committed
enhance: manually update local branch tree after checking out and fast-forward a exiting local branch (#2169)
Signed-off-by: leo <longshuang@msn.cn>
1 parent c47f819 commit 5fdd4e3

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/ViewModels/CheckoutAndFastForward.cs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,19 @@ public override async Task<bool> Sure()
8080
await new Commands.Stash(_repo.FullPath)
8181
.Use(log)
8282
.PopAsync("stash@{0}");
83-
}
84-
85-
log.Complete();
8683

87-
if (_repo.HistoryFilterMode == Models.FilterMode.Included)
88-
_repo.SetBranchFilterMode(LocalBranch, Models.FilterMode.Included, false, false);
84+
LocalBranch.Behind.Clear();
85+
LocalBranch.Head = RemoteBranch.Head;
86+
LocalBranch.CommitterDate = RemoteBranch.CommitterDate;
8987

90-
_repo.MarkBranchesDirtyManually();
88+
_repo.FastRefreshBranchesAfterCheckout(LocalBranch);
89+
}
90+
else
91+
{
92+
_repo.MarkWorkingCopyDirtyManually();
93+
}
9194

92-
ProgressDescription = "Waiting for branch updated...";
93-
await Task.Delay(400);
95+
log.Complete();
9496
return succ;
9597
}
9698

0 commit comments

Comments
 (0)