mirror of
https://fastgit.cc/github.com/sourcegit-scm/sourcegit
synced 2026-04-25 03:12:21 +08:00
feature: asking to create local branch instead of checkout commit if some remote branch's HEAD is selected commit (#295)
This commit is contained in:
@@ -147,6 +147,7 @@ namespace SourceGit.ViewModels
|
||||
if (commit == null || commit.IsCurrentHead)
|
||||
return;
|
||||
|
||||
var firstRemoteBranch = null as Models.Branch;
|
||||
foreach (var d in commit.Decorators)
|
||||
{
|
||||
if (d.Type == Models.DecoratorType.LocalBranchHead)
|
||||
@@ -158,10 +159,19 @@ namespace SourceGit.ViewModels
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (d.Type == Models.DecoratorType.RemoteBranchHead && firstRemoteBranch == null)
|
||||
{
|
||||
firstRemoteBranch = _repo.Branches.Find(x => x.FriendlyName == d.Name);
|
||||
}
|
||||
}
|
||||
|
||||
if (PopupHost.CanCreatePopup())
|
||||
PopupHost.ShowPopup(new CheckoutCommit(_repo, commit));
|
||||
{
|
||||
if (firstRemoteBranch != null)
|
||||
PopupHost.ShowPopup(new CreateBranch(_repo, firstRemoteBranch));
|
||||
else
|
||||
PopupHost.ShowPopup(new CheckoutCommit(_repo, commit));
|
||||
}
|
||||
}
|
||||
|
||||
public ContextMenu MakeContextMenu(DataGrid datagrid)
|
||||
|
||||
Reference in New Issue
Block a user