mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 04:15:48 +02:00
Bugfix: don't allow dropping patches from a custom patch that was made in diffing mode
The three nested `if` statements may looks strange, and you might wonder why we don't have single one with &&. The answer is that later in this branch we will add an `else` block to the middle one.
This commit is contained in:
parent
14a29d6d6f
commit
567e898e22
1 changed files with 10 additions and 1 deletions
|
@ -62,10 +62,19 @@ func (self *SwitchToDiffFilesController) GetOnClick() func() error {
|
|||
func (self *SwitchToDiffFilesController) enter(ref types.Ref) error {
|
||||
commitFilesContext := self.c.Contexts().CommitFiles
|
||||
|
||||
canRebase := self.context.CanRebase()
|
||||
if canRebase {
|
||||
if self.c.Modes().Diffing.Active() {
|
||||
if self.c.Modes().Diffing.Ref != ref.RefName() {
|
||||
canRebase = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
commitFilesContext.SetSelection(0)
|
||||
commitFilesContext.SetRef(ref)
|
||||
commitFilesContext.SetTitleRef(ref.Description())
|
||||
commitFilesContext.SetCanRebase(self.context.CanRebase())
|
||||
commitFilesContext.SetCanRebase(canRebase)
|
||||
commitFilesContext.SetParentContext(self.context)
|
||||
commitFilesContext.SetWindowName(self.context.GetWindowName())
|
||||
commitFilesContext.ClearSearchString()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue