summaryrefslogtreecommitdiffstats
path: root/pkg/commands
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2021-03-21 10:47:42 +1100
committerJesse Duffield <jessedduffield@gmail.com>2021-03-30 21:57:00 +1100
commit1f7273af23570e408e30b261eb748f3dfc6cf681 (patch)
tree13e81923c21bbee8c10d9ab85a0fba3dca844f77 /pkg/commands
parent2b8302bceddc7391ded956418029349a85824c7b (diff)
better way to check if a node is a leaf
Diffstat (limited to 'pkg/commands')
-rw-r--r--pkg/commands/models/file_change_node.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/commands/models/file_change_node.go b/pkg/commands/models/file_change_node.go
index d265b3f05..85ce2e298 100644
--- a/pkg/commands/models/file_change_node.go
+++ b/pkg/commands/models/file_change_node.go
@@ -95,7 +95,7 @@ func (s *FileChangeNode) getIndexForPathAux(path string, collapsedPaths map[stri
}
func (s *FileChangeNode) IsLeaf() bool {
- return len(s.Children) == 0
+ return s.File != nil
}
func (s *FileChangeNode) Size(collapsedPaths map[string]bool) int {