mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-31 14:24:25 +03:00
Remove bool return value of GetParentContext()
The comments that I'm deleting here explain why we need the bool; however, in our case that's a theoretical issue. It would only arise if we ever were to pass a nil context to SetParentContext, which we never do.
This commit is contained in:
@ -178,8 +178,8 @@ func (self *CommitFilesController) checkout(node *filetree.CommitFileNode) error
|
||||
}
|
||||
|
||||
func (self *CommitFilesController) discard(selectedNodes []*filetree.CommitFileNode) error {
|
||||
parentContext, ok := self.c.Context().Current().GetParentContext()
|
||||
if !ok || parentContext.GetKey() != context.LOCAL_COMMITS_CONTEXT_KEY {
|
||||
parentContext := self.c.Context().Current().GetParentContext()
|
||||
if parentContext == nil || parentContext.GetKey() != context.LOCAL_COMMITS_CONTEXT_KEY {
|
||||
return errors.New(self.c.Tr.CanOnlyDiscardFromLocalCommits)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user