From bbd4012bc50cd09b17c685306e9c2869e3c30888 Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 18 Sep 2024 16:02:38 +0800 Subject: [PATCH] enhance: do NOT create sub-nodes for detached HEAD --- src/ViewModels/BranchTreeNode.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ViewModels/BranchTreeNode.cs b/src/ViewModels/BranchTreeNode.cs index 71f96a90..e3e65da0 100644 --- a/src/ViewModels/BranchTreeNode.cs +++ b/src/ViewModels/BranchTreeNode.cs @@ -120,7 +120,7 @@ namespace SourceGit.ViewModels private void MakeBranchNode(Models.Branch branch, List roots, Dictionary folders, string prefix, bool isFiltered, bool bForceExpanded) { var sepIdx = branch.Name.IndexOf('/', StringComparison.Ordinal); - if (sepIdx == -1) + if (sepIdx == -1 || branch.IsDetachedHead) { roots.Add(new BranchTreeNode() {