MCPcopy
hub / github.com/jesseduffield/lazygit / RemoveFileLineRange

Method RemoveFileLineRange

pkg/commands/patch/patch_builder.go:158–170  ·  view source on GitHub ↗
(filename string, lineIndices []int)

Source from the content-addressed store, hash-verified

156}
157
158func (p *PatchBuilder) RemoveFileLineRange(filename string, lineIndices []int) error {
159 info, err := p.getFileInfo(filename)
160 if err != nil {
161 return err
162 }
163 info.mode = PART
164 info.includedLineIndices, _ = lo.Difference(info.includedLineIndices, lineIndices)
165 if len(info.includedLineIndices) == 0 {
166 p.removeFile(info)
167 }
168
169 return nil
170}
171
172type RenderPatchForFileOpts struct {
173 Filename string

Callers

nothing calls this directly

Calls 2

getFileInfoMethod · 0.95
removeFileMethod · 0.95

Tested by

no test coverage detected