summaryrefslogtreecommitdiffstats
path: root/pkg/gui/controllers/commits_files_controller.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2022-07-31 19:10:16 +1000
committerJesse Duffield <jessedduffield@gmail.com>2022-07-31 19:43:14 +1000
commit682be18507ecf202116100547cb5049f471af664 (patch)
tree27c93b614f10f682ae952c1e39390e253afc83b4 /pkg/gui/controllers/commits_files_controller.go
parent2ca2acaca55711a63e48e5d0c8f0c0678218b81c (diff)
refactor to use generics for file nodes
use less generic names
Diffstat (limited to 'pkg/gui/controllers/commits_files_controller.go')
-rw-r--r--pkg/gui/controllers/commits_files_controller.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/pkg/gui/controllers/commits_files_controller.go b/pkg/gui/controllers/commits_files_controller.go
index 20e78997e..5beecba02 100644
--- a/pkg/gui/controllers/commits_files_controller.go
+++ b/pkg/gui/controllers/commits_files_controller.go
@@ -165,7 +165,7 @@ func (self *CommitFilesController) toggleForPatch(node *filetree.CommitFileNode)
// if there is any file that hasn't been fully added we'll fully add everything,
// otherwise we'll remove everything
- adding := node.AnyFile(func(file *models.CommitFile) bool {
+ adding := node.SomeFile(func(file *models.CommitFile) bool {
return self.git.Patch.PatchManager.GetFileStatus(file.Name, self.context().GetRef().RefName()) != patch.WHOLE
})
@@ -203,8 +203,7 @@ func (self *CommitFilesController) toggleForPatch(node *filetree.CommitFileNode)
}
func (self *CommitFilesController) toggleAllForPatch(_ *filetree.CommitFileNode) error {
- // not a fan of type assertions but this will be fixed very soon thanks to generics
- root := self.context().CommitFileTreeViewModel.Tree().(*filetree.CommitFileNode)
+ root := self.context().CommitFileTreeViewModel.GetRoot()
return self.toggleForPatch(root)
}