Skip to content

Commit 8eb35a8

Browse files
author
Cameron Way
committed
Fix tags not refreshing after config change
1 parent 5d543a2 commit 8eb35a8

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

pkg/commands/git_commands/commit_loader.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,6 @@ func (self *CommitLoader) extractCommitFromLine(hashPool *utils.StringPool, line
213213
message := split[7]
214214

215215
tags := []string{}
216-
if self.AppState.GitLogShowTags == "never" {
217-
extraInfo = regexp.MustCompile(`tag: [^,]+,?\s*`).ReplaceAllString(extraInfo, "")
218-
}
219216

220217
if extraInfo != "" {
221218
extraInfoFields := strings.Split(extraInfo, ",")

pkg/gui/presentation/commits.go

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package presentation
22

33
import (
44
"fmt"
5+
"regexp"
56
"strings"
67
"time"
78

@@ -394,9 +395,15 @@ func displayCommit(
394395
}
395396

396397
tagString := ""
397-
if fullDescription {
398-
if commit.ExtraInfo != "" {
399-
tagString = style.FgMagenta.SetBold().Sprint(commit.ExtraInfo) + " "
398+
if fullDescription && commit.ExtraInfo != "" {
399+
extraInfo := commit.ExtraInfo
400+
if !showTags {
401+
// Remove tags from the extra info
402+
extraInfo = regexp.MustCompile(`tag: [^,)\s]+,?\s*`).ReplaceAllString(commit.ExtraInfo, "")
403+
extraInfo = strings.Replace(extraInfo, "()", "", 1)
404+
}
405+
if extraInfo != "" {
406+
tagString = style.FgMagenta.SetBold().Sprint(extraInfo) + " "
400407
}
401408
} else {
402409
if showTags && len(commit.Tags) > 0 {

0 commit comments

Comments
 (0)