(info *fileInfo)
| 85 | } |
| 86 | |
| 87 | func (p *PatchBuilder) addFileWhole(info *fileInfo) { |
| 88 | if info.mode != WHOLE { |
| 89 | info.mode = WHOLE |
| 90 | lineCount := len(strings.Split(info.diff, "\n")) |
| 91 | // add every line index |
| 92 | // TODO: add tests and then use lo.Range to simplify |
| 93 | info.includedLineIndices = make([]int, lineCount) |
| 94 | for i := range lineCount { |
| 95 | info.includedLineIndices[i] = i |
| 96 | } |
| 97 | } |
| 98 | } |
| 99 | |
| 100 | func (p *PatchBuilder) removeFile(info *fileInfo) { |
| 101 | info.mode = UNSELECTED |