1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-19 00:28:03 +02:00

Pass common.Common to file trees instead of just the Log

We will need a user config in the file tree in the next commit, and passing the
entire common is the easiest way to do that while ensuring hot-reloading when
users change the config while lazygit is running.
This commit is contained in:
Stefan Haller
2025-05-24 15:18:05 +02:00
parent da32b59e11
commit ffb8586795
7 changed files with 21 additions and 18 deletions

View File

@ -2,9 +2,9 @@ package filetree
import (
"github.com/jesseduffield/lazygit/pkg/commands/models"
"github.com/jesseduffield/lazygit/pkg/common"
"github.com/jesseduffield/lazygit/pkg/gui/types"
"github.com/samber/lo"
"github.com/sirupsen/logrus"
)
type ICommitFileTree interface {
@ -21,7 +21,7 @@ type CommitFileTree struct {
getFiles func() []*models.CommitFile
tree *Node[models.CommitFile]
showTree bool
log *logrus.Entry
common *common.Common
collapsedPaths *CollapsedPaths
}
@ -41,10 +41,10 @@ func (self *CommitFileTree) ExpandAll() {
var _ ICommitFileTree = &CommitFileTree{}
func NewCommitFileTree(getFiles func() []*models.CommitFile, log *logrus.Entry, showTree bool) *CommitFileTree {
func NewCommitFileTree(getFiles func() []*models.CommitFile, common *common.Common, showTree bool) *CommitFileTree {
return &CommitFileTree{
getFiles: getFiles,
log: log,
common: common,
showTree: showTree,
collapsedPaths: NewCollapsedPaths(),
}