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

Bundle the reverse and keepOriginalHeader flags into a PatchOptions struct

We are going to add one more flag in the next commit.

Note that we are not using the struct inside patch_manager.go; we keep passing
the individual flags there. The reason for this will become more obvious later
in this branch.
This commit is contained in:
Stefan Haller
2023-02-26 13:20:10 +01:00
parent 5a50bfd179
commit f76cc27956
4 changed files with 29 additions and 14 deletions

View File

@ -176,7 +176,8 @@ func (p *PatchManager) renderPlainPatchForFile(filename string, reverse bool, ke
return info.diff
case PART:
// generate a new diff with just the selected lines
return ModifiedPatchForLines(p.Log, filename, info.diff, info.includedLineIndices, reverse, keepOriginalHeader)
return ModifiedPatchForLines(p.Log, filename, info.diff, info.includedLineIndices,
PatchOptions{Reverse: reverse, KeepOriginalHeader: keepOriginalHeader})
default:
return ""
}