diff --git a/src/ViewModels/Histories.cs b/src/ViewModels/Histories.cs index 9ec3a897..caeba32f 100644 --- a/src/ViewModels/Histories.cs +++ b/src/ViewModels/Histories.cs @@ -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)