diff --git a/src/Commands/QueryCommits.cs b/src/Commands/QueryCommits.cs index 7d6ad169..618ff014 100644 --- a/src/Commands/QueryCommits.cs +++ b/src/Commands/QueryCommits.cs @@ -146,6 +146,15 @@ namespace SourceGit.Commands Name = d.Substring(19).Trim(), }); } + else if (d.Equals("HEAD")) + { + isHeadOfCurrent = true; + decorators.Add(new Models.Decorator() + { + Type = Models.DecoratorType.CurrentCommitHead, + Name = d.Trim(), + }); + } else if (d.StartsWith("refs/heads/", StringComparison.Ordinal)) { decorators.Add(new Models.Decorator() diff --git a/src/Converters/DecoratorTypeConverters.cs b/src/Converters/DecoratorTypeConverters.cs index eb016360..9f3d9447 100644 --- a/src/Converters/DecoratorTypeConverters.cs +++ b/src/Converters/DecoratorTypeConverters.cs @@ -38,6 +38,9 @@ namespace SourceGit.Converters }); public static readonly FuncValueConverter ToFontWeight = - new FuncValueConverter(v => v == Models.DecoratorType.CurrentBranchHead ? FontWeight.Bold : FontWeight.Regular); + new FuncValueConverter(v => + v is Models.DecoratorType.CurrentBranchHead or Models.DecoratorType.CurrentCommitHead + ? FontWeight.Bold : FontWeight.Regular + ); } } diff --git a/src/Models/Commit.cs b/src/Models/Commit.cs index 4b3f0ed3..d8355e81 100644 --- a/src/Models/Commit.cs +++ b/src/Models/Commit.cs @@ -32,7 +32,7 @@ namespace SourceGit.Models public bool IsCurrentHead { - get => Decorators.Find(x => x.Type == DecoratorType.CurrentBranchHead) != null; + get => Decorators.Find(x => x.Type is DecoratorType.CurrentBranchHead or DecoratorType.CurrentCommitHead) != null; } public string FullMessage diff --git a/src/Models/Decorator.cs b/src/Models/Decorator.cs index 10967b45..60ffc1ee 100644 --- a/src/Models/Decorator.cs +++ b/src/Models/Decorator.cs @@ -7,6 +7,7 @@ namespace SourceGit.Models None, CurrentBranchHead, LocalBranchHead, + CurrentCommitHead, RemoteBranchHead, Tag, }