MCPcopy
hub / github.com/jesseduffield/lazygit / RenderCommitFileTree

Function RenderCommitFileTree

pkg/gui/presentation/files.go:38–50  ·  view source on GitHub ↗
(
	tree *filetree.CommitFileTreeViewModel,
	patchBuilder *patch.PatchBuilder,
	showFileIcons bool,
	customIconsConfig *config.CustomIconsConfig,
)

Source from the content-addressed store, hash-verified

36}
37
38func 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
53func commitFilePatchStatus(node *filetree.Node[models.CommitFile], tree *filetree.CommitFileTreeViewModel, patchBuilder *patch.PatchBuilder) patch.PatchStatus {

Callers 2

NewCommitFilesContextFunction · 0.92
TestRenderCommitFileTreeFunction · 0.85

Calls 6

renderAuxFunction · 0.85
commitFilePatchStatusFunction · 0.85
getCommitFileLineFunction · 0.85
CollapsedPathsMethod · 0.65
GetRootMethod · 0.65
RawMethod · 0.45

Tested by 1

TestRenderCommitFileTreeFunction · 0.68