mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-02-03 13:21:56 +02:00
Remove parameters that are no longer needed
All callers in this file now use reverseOnGenerate=false and keepOriginalHeader=true, so hard-code that in the call to ModifiedPatchForLines and get rid of the parameters.
This commit is contained in:
parent
5d692e8961
commit
6bd1c1d068
@ -162,7 +162,7 @@ func (p *PatchManager) RemoveFileLineRange(filename string, firstLineIdx, lastLi
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *PatchManager) renderPlainPatchForFile(filename string, reverse bool, willBeAppliedReverse bool, keepOriginalHeader bool) string {
|
||||
func (p *PatchManager) renderPlainPatchForFile(filename string, willBeAppliedReverse bool) string {
|
||||
info, err := p.getFileInfo(filename)
|
||||
if err != nil {
|
||||
p.Log.Error(err)
|
||||
@ -178,17 +178,17 @@ func (p *PatchManager) renderPlainPatchForFile(filename string, reverse bool, wi
|
||||
// generate a new diff with just the selected lines
|
||||
return ModifiedPatchForLines(p.Log, filename, info.diff, info.includedLineIndices,
|
||||
PatchOptions{
|
||||
Reverse: reverse,
|
||||
Reverse: false,
|
||||
WillBeAppliedReverse: willBeAppliedReverse,
|
||||
KeepOriginalHeader: keepOriginalHeader,
|
||||
KeepOriginalHeader: true,
|
||||
})
|
||||
default:
|
||||
return ""
|
||||
}
|
||||
}
|
||||
|
||||
func (p *PatchManager) RenderPatchForFile(filename string, plain bool, reverse bool, willBeAppliedReverse bool, keepOriginalHeader bool) string {
|
||||
patch := p.renderPlainPatchForFile(filename, reverse, willBeAppliedReverse, keepOriginalHeader)
|
||||
func (p *PatchManager) RenderPatchForFile(filename string, plain bool, willBeAppliedReverse bool) string {
|
||||
patch := p.renderPlainPatchForFile(filename, willBeAppliedReverse)
|
||||
if plain {
|
||||
return patch
|
||||
}
|
||||
@ -204,7 +204,7 @@ func (p *PatchManager) renderEachFilePatch(plain bool) []string {
|
||||
|
||||
sort.Strings(filenames)
|
||||
patches := slices.Map(filenames, func(filename string) string {
|
||||
return p.RenderPatchForFile(filename, plain, false, false, true)
|
||||
return p.RenderPatchForFile(filename, plain, false)
|
||||
})
|
||||
output := slices.Filter(patches, func(patch string) bool {
|
||||
return patch != ""
|
||||
@ -255,7 +255,7 @@ func (p *PatchManager) ApplyPatches(reverse bool) error {
|
||||
continue
|
||||
}
|
||||
|
||||
patch := p.RenderPatchForFile(filename, true, false, reverse, true)
|
||||
patch := p.RenderPatchForFile(filename, true, reverse)
|
||||
if patch != "" {
|
||||
err := p.applyPatch(patch, applyFlags...)
|
||||
if err != nil {
|
||||
|
@ -672,7 +672,7 @@ func (gui *Gui) refreshPatchBuildingPanel(opts types.OnFocusOpts) error {
|
||||
return err
|
||||
}
|
||||
|
||||
secondaryDiff := gui.git.Patch.PatchManager.RenderPatchForFile(path, false, false, false, true)
|
||||
secondaryDiff := gui.git.Patch.PatchManager.RenderPatchForFile(path, false, false)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user