From a899de2b983f73339a64b1961de77f0b9878dee9 Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 18 Dec 2024 17:50:19 +0800 Subject: [PATCH] enhance: ignore `refs/*/HEAD` when query refs those contains given commit --- src/Commands/QueryRefsContainsCommit.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Commands/QueryRefsContainsCommit.cs b/src/Commands/QueryRefsContainsCommit.cs index e3b73ccc..82e9b341 100644 --- a/src/Commands/QueryRefsContainsCommit.cs +++ b/src/Commands/QueryRefsContainsCommit.cs @@ -23,6 +23,9 @@ namespace SourceGit.Commands var lines = output.StdOut.Split('\n'); foreach (var line in lines) { + if (line.EndsWith("/HEAD", StringComparison.Ordinal)) + continue; + if (line.StartsWith("refs/heads/", StringComparison.Ordinal)) rs.Add(new() { Name = line.Substring("refs/heads/".Length), Type = Models.DecoratorType.LocalBranchHead }); else if (line.StartsWith("refs/remotes/", StringComparison.Ordinal))