| 36 | } |
| 37 | |
| 38 | func RenderCommitFileTree( |
| 39 | tree *filetree.CommitFileTreeViewModel, |
| 40 | patchBuilder *patch.PatchBuilder, |
| 41 | showFileIcons bool, |
| 42 | customIconsConfig *config.CustomIconsConfig, |
| 43 | ) []string { |
| 44 | collapsedPaths := tree.CollapsedPaths() |
| 45 | return renderAux(tree.GetRoot().Raw(), collapsedPaths, -1, -1, func(node *filetree.Node[models.CommitFile], treeDepth int, visualDepth int, isCollapsed bool) string { |
| 46 | status := commitFilePatchStatus(node, tree, patchBuilder) |
| 47 | |
| 48 | return getCommitFileLine(isCollapsed, treeDepth, visualDepth, node, status, showFileIcons, customIconsConfig) |
| 49 | }) |
| 50 | } |
| 51 | |
| 52 | // Returns the status of a commit file in terms of its inclusion in the custom patch |
| 53 | func commitFilePatchStatus(node *filetree.Node[models.CommitFile], tree *filetree.CommitFileTreeViewModel, patchBuilder *patch.PatchBuilder) patch.PatchStatus { |