1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2024-12-04 10:34:55 +02:00
lazygit/pkg/gui/filetree/commit_file_node.go
2022-08-01 20:32:01 +10:00

26 lines
569 B
Go

package filetree
import "github.com/jesseduffield/lazygit/pkg/commands/models"
// CommitFileNode wraps a node and provides some commit-file-specific methods for it.
type CommitFileNode struct {
*Node[models.CommitFile]
}
func NewCommitFileNode(node *Node[models.CommitFile]) *CommitFileNode {
if node == nil {
return nil
}
return &CommitFileNode{Node: node}
}
// returns the underlying node, without any commit-file-specific methods attached
func (self *CommitFileNode) Raw() *Node[models.CommitFile] {
if self == nil {
return nil
}
return self.Node
}