summaryrefslogtreecommitdiffstats
path: root/pkg/gui/presentation
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2022-01-30 16:38:07 +1100
committerJesse Duffield <jessedduffield@gmail.com>2022-03-17 19:13:40 +1100
commitb5515da00b916bcf79f680b360d5c00e08932338 (patch)
tree689e04bf5c79ea6578a3f7a09f25b93a9ce75809 /pkg/gui/presentation
parentc084abb378bc4ae2902e52f399c0f53968d1e717 (diff)
move commit files context into new structure
Diffstat (limited to 'pkg/gui/presentation')
-rw-r--r--pkg/gui/presentation/files.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/pkg/gui/presentation/files.go b/pkg/gui/presentation/files.go
index 88b9491d9..3efb8d29b 100644
--- a/pkg/gui/presentation/files.go
+++ b/pkg/gui/presentation/files.go
@@ -21,22 +21,22 @@ const NESTED = "│ "
const NOTHING = " "
func RenderFileTree(
- fileMgr filetree.IFileTree,
+ tree filetree.IFileTree,
diffName string,
submoduleConfigs []*models.SubmoduleConfig,
) []string {
- return renderAux(fileMgr.Tree(), fileMgr.CollapsedPaths(), "", -1, func(n filetree.INode, depth int) string {
+ return renderAux(tree.Tree(), tree.CollapsedPaths(), "", -1, func(n filetree.INode, depth int) string {
castN := n.(*filetree.FileNode)
return getFileLine(castN.GetHasUnstagedChanges(), castN.GetHasStagedChanges(), castN.NameAtDepth(depth), diffName, submoduleConfigs, castN.File)
})
}
func RenderCommitFileTree(
- commitFileMgr *filetree.CommitFileTreeViewModel,
+ tree *filetree.CommitFileTreeViewModel,
diffName string,
patchManager *patch.PatchManager,
) []string {
- return renderAux(commitFileMgr.Tree(), commitFileMgr.CollapsedPaths(), "", -1, func(n filetree.INode, depth int) string {
+ return renderAux(tree.Tree(), tree.CollapsedPaths(), "", -1, func(n filetree.INode, depth int) string {
castN := n.(*filetree.CommitFileNode)
// This is a little convoluted because we're dealing with either a leaf or a non-leaf.
@@ -45,11 +45,11 @@ func RenderCommitFileTree(
// based on the leaves of that subtree
var status patch.PatchStatus
if castN.EveryFile(func(file *models.CommitFile) bool {
- return patchManager.GetFileStatus(file.Name, commitFileMgr.GetParent()) == patch.WHOLE
+ return patchManager.GetFileStatus(file.Name, tree.GetRefName()) == patch.WHOLE
}) {
status = patch.WHOLE
} else if castN.EveryFile(func(file *models.CommitFile) bool {
- return patchManager.GetFileStatus(file.Name, commitFileMgr.GetParent()) == patch.UNSELECTED
+ return patchManager.GetFileStatus(file.Name, tree.GetRefName()) == patch.UNSELECTED
}) {
status = patch.UNSELECTED
} else {