1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

Remove the PatchOptions.Reverse option

All callers pass false now (except for the tests, which we simply remove), so we
don't need the option any more.
This commit is contained in:
Stefan Haller
2023-03-07 09:31:38 +01:00
parent e4659145e8
commit 45cf993982
5 changed files with 12 additions and 201 deletions

View File

@ -182,7 +182,7 @@ func (self *StagingController) applySelection(reverse bool) error {
firstLineIdx, lastLineIdx := state.SelectedRange()
patch := patch.ModifiedPatchForRange(self.c.Log, path, state.GetDiff(), firstLineIdx, lastLineIdx,
patch.PatchOptions{Reverse: false, WillBeAppliedReverse: reverse, KeepOriginalHeader: false})
patch.PatchOptions{WillBeAppliedReverse: reverse, KeepOriginalHeader: false})
if patch == "" {
return nil
@ -232,7 +232,7 @@ func (self *StagingController) editHunk() error {
hunk := state.CurrentHunk()
patchText := patch.ModifiedPatchForRange(
self.c.Log, path, state.GetDiff(), hunk.FirstLineIdx, hunk.LastLineIdx(),
patch.PatchOptions{Reverse: false, WillBeAppliedReverse: self.staged, KeepOriginalHeader: false},
patch.PatchOptions{WillBeAppliedReverse: self.staged, KeepOriginalHeader: false},
)
patchFilepath, err := self.git.WorkingTree.SaveTemporaryPatch(patchText)
if err != nil {
@ -255,7 +255,7 @@ func (self *StagingController) editHunk() error {
lineCount := strings.Count(editedPatchText, "\n") + 1
newPatchText := patch.ModifiedPatchForRange(
self.c.Log, path, editedPatchText, 0, lineCount,
patch.PatchOptions{Reverse: false, KeepOriginalHeader: false},
patch.PatchOptions{KeepOriginalHeader: false},
)
applyFlags := []string{"cached"}