mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-06-16 07:55:00 +00:00
feature: double tap commit with tracked remote branch checks out local tracking branch (#1409)
This commit is contained in:
parent
ee4d8a6a0e
commit
6c04f5390a
1 changed files with 17 additions and 2 deletions
|
@ -231,9 +231,24 @@ namespace SourceGit.ViewModels
|
|||
return;
|
||||
}
|
||||
}
|
||||
else if (d.Type == Models.DecoratorType.RemoteBranchHead && firstRemoteBranch == null)
|
||||
else if (d.Type == Models.DecoratorType.RemoteBranchHead)
|
||||
{
|
||||
firstRemoteBranch = _repo.Branches.Find(x => x.FriendlyName == d.Name);
|
||||
var remoteBranch = _repo.Branches.Find(x => x.FriendlyName == d.Name);
|
||||
if (remoteBranch != null)
|
||||
{
|
||||
var localBranch = _repo.Branches.Find(x => x.IsLocal && x.Upstream == remoteBranch.FullName);
|
||||
if (localBranch != null)
|
||||
{
|
||||
if (!localBranch.IsCurrent)
|
||||
_repo.CheckoutBranch(localBranch);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (firstRemoteBranch == null)
|
||||
{
|
||||
firstRemoteBranch = remoteBranch;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue