enhance: create branch on detached HEAD (#344)

This commit is contained in:
leo 2024-08-09 16:06:28 +08:00
parent c596427380
commit ed2d3279e1
No known key found for this signature in database
5 changed files with 5 additions and 5 deletions

View file

@ -35,7 +35,7 @@ namespace SourceGit.ViewModels
public CreateBranch(Repository repo, Models.Branch branch)
{
_repo = repo;
_baseOnRevision = branch.FullName;
_baseOnRevision = branch.IsDetachedHead ? branch.Head : branch.FullName;
if (!branch.IsLocal && repo.Branches.Find(x => x.IsLocal && x.Name == branch.Name) == null)
{