Skip to content

Commit ee62878

Browse files
committed
Cleanup: remove pointless error handling
ForEachFile can't possibly return an error if the passed function doesn't return one.
1 parent 2a59702 commit ee62878

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

pkg/gui/controllers/commits_files_controller.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -319,13 +319,10 @@ func (self *CommitFilesController) discard(selectedNodes []*filetree.CommitFileN
319319
}
320320

321321
for _, node := range selectedNodes {
322-
err := node.ForEachFile(func(file *models.CommitFile) error {
322+
_ = node.ForEachFile(func(file *models.CommitFile) error {
323323
filePaths = append(filePaths, file.GetPath())
324324
return nil
325325
})
326-
if err != nil {
327-
return err
328-
}
329326
}
330327

331328
err := self.c.Git().Rebase.DiscardOldFileChanges(self.c.Model().Commits, self.c.Contexts().LocalCommits.GetSelectedLineIdx(), filePaths)

0 commit comments

Comments
 (0)