mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-08-06 22:33:07 +02:00
Use a different way to check if a tag is annotated
Storing it in the Tag struct makes loading tags a lot slower when there is a very large number of tags; so determine it on the fly instead. On my machine, the additional call takes under 5ms, so it seems we can afford it.
This commit is contained in:
@ -117,7 +117,12 @@ func (self *TagsController) GetOnRenderToMain() func() {
|
||||
}
|
||||
|
||||
func (self *TagsController) getTagInfo(tag *models.Tag) string {
|
||||
if tag.IsAnnotated {
|
||||
tagIsAnnotated, err := self.c.Git().Tag.IsTagAnnotated(tag.Name)
|
||||
if err != nil {
|
||||
self.c.Log.Warnf("Error checking if tag is annotated: %v", err)
|
||||
}
|
||||
|
||||
if tagIsAnnotated {
|
||||
info := fmt.Sprintf("%s: %s", self.c.Tr.AnnotatedTag, style.AttrBold.Sprint(style.FgYellow.Sprint(tag.Name)))
|
||||
output, err := self.c.Git().Tag.ShowAnnotationInfo(tag.Name)
|
||||
if err == nil {
|
||||
|
Reference in New Issue
Block a user