mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-04-23 12:18:51 +02:00
Bugfix: more comprehensive check whether custom patch must be reset
We need to compare more than just the "To" ref. The NewPatchRequired function existed already for this purpose, it just wasn't used.
This commit is contained in:
parent
8e2ed8c538
commit
14a29d6d6f
@ -307,7 +307,8 @@ func (self *CommitFilesController) toggleForPatch(selectedNodes []*filetree.Comm
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
if self.c.Git().Patch.PatchBuilder.Active() && self.c.Git().Patch.PatchBuilder.To != self.context().GetRef().RefName() {
|
from, to, reverse := self.currentFromToReverseForPatchBuilding()
|
||||||
|
if self.c.Git().Patch.PatchBuilder.Active() && self.c.Git().Patch.PatchBuilder.NewPatchRequired(from, to, reverse) {
|
||||||
return self.c.Confirm(types.ConfirmOpts{
|
return self.c.Confirm(types.ConfirmOpts{
|
||||||
Title: self.c.Tr.DiscardPatch,
|
Title: self.c.Tr.DiscardPatch,
|
||||||
Prompt: self.c.Tr.DiscardPatchConfirm,
|
Prompt: self.c.Tr.DiscardPatchConfirm,
|
||||||
@ -364,7 +365,8 @@ func (self *CommitFilesController) enterCommitFile(node *filetree.CommitFileNode
|
|||||||
return self.c.Context().Push(self.c.Contexts().CustomPatchBuilder, opts)
|
return self.c.Context().Push(self.c.Contexts().CustomPatchBuilder, opts)
|
||||||
}
|
}
|
||||||
|
|
||||||
if self.c.Git().Patch.PatchBuilder.Active() && self.c.Git().Patch.PatchBuilder.To != self.context().GetRef().RefName() {
|
from, to, reverse := self.currentFromToReverseForPatchBuilding()
|
||||||
|
if self.c.Git().Patch.PatchBuilder.Active() && self.c.Git().Patch.PatchBuilder.NewPatchRequired(from, to, reverse) {
|
||||||
return self.c.Confirm(types.ConfirmOpts{
|
return self.c.Confirm(types.ConfirmOpts{
|
||||||
Title: self.c.Tr.DiscardPatch,
|
Title: self.c.Tr.DiscardPatch,
|
||||||
Prompt: self.c.Tr.DiscardPatchConfirm,
|
Prompt: self.c.Tr.DiscardPatchConfirm,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user