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

Method getFileInfo

pkg/commands/patch/patch_builder.go:127–145  ·  view source on GitHub ↗
(filename string)

Source from the content-addressed store, hash-verified

125}
126
127func (p *PatchBuilder) getFileInfo(filename string) (*fileInfo, error) {
128 info, ok := p.fileInfoMap[filename]
129 if ok {
130 return info, nil
131 }
132
133 diff, err := p.loadFileDiff(p.From, p.To, p.reverse, filename, true)
134 if err != nil {
135 return nil, err
136 }
137 info = &fileInfo{
138 mode: UNSELECTED,
139 diff: diff,
140 }
141
142 p.fileInfoMap[filename] = info
143
144 return info, nil
145}
146
147func (p *PatchBuilder) AddFileLineRange(filename string, lineIndices []int) error {
148 info, err := p.getFileInfo(filename)

Callers 6

AddFileWholeMethod · 0.95
RemoveFileMethod · 0.95
AddFileLineRangeMethod · 0.95
RemoveFileLineRangeMethod · 0.95
RenderPatchForFileMethod · 0.95
GetFileIncLineIndicesMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected