mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-06-17 00:14:59 +00:00
feature: when trying to checkout a local branch from its tracking upstream and it is behind the upstream, show Checkout & Fast-Forward
popup
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
6c04f5390a
commit
7d0536d94b
8 changed files with 203 additions and 6 deletions
|
@ -1316,7 +1316,7 @@ namespace SourceGit.ViewModels
|
|||
{
|
||||
if (branch.IsLocal)
|
||||
{
|
||||
var worktree = _worktrees.Find(x => x.Branch == branch.FullName);
|
||||
var worktree = _worktrees.Find(x => x.Branch.Equals(branch.FullName, StringComparison.Ordinal));
|
||||
if (worktree != null)
|
||||
{
|
||||
OpenWorktree(worktree);
|
||||
|
@ -1341,9 +1341,13 @@ namespace SourceGit.ViewModels
|
|||
{
|
||||
foreach (var b in _branches)
|
||||
{
|
||||
if (b.IsLocal && b.Upstream == branch.FullName)
|
||||
if (b.IsLocal &&
|
||||
b.Upstream.Equals(branch.FullName, StringComparison.Ordinal) &&
|
||||
b.TrackStatus.Ahead.Count == 0)
|
||||
{
|
||||
if (!b.IsCurrent)
|
||||
if (b.TrackStatus.Behind.Count > 0)
|
||||
ShowPopup(new CheckoutAndFastForward(this, b, branch));
|
||||
else if (!b.IsCurrent)
|
||||
CheckoutBranch(b);
|
||||
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue