(reverse bool, turnAddedFilesIntoDiffAgainstEmptyFile bool)
| 66 | } |
| 67 | |
| 68 | func (p *PatchBuilder) PatchToApply(reverse bool, turnAddedFilesIntoDiffAgainstEmptyFile bool) string { |
| 69 | var patch strings.Builder |
| 70 | |
| 71 | for filename, info := range p.fileInfoMap { |
| 72 | if info.mode == UNSELECTED { |
| 73 | continue |
| 74 | } |
| 75 | |
| 76 | patch.WriteString(p.RenderPatchForFile(RenderPatchForFileOpts{ |
| 77 | Filename: filename, |
| 78 | Plain: true, |
| 79 | Reverse: reverse, |
| 80 | TurnAddedFilesIntoDiffAgainstEmptyFile: turnAddedFilesIntoDiffAgainstEmptyFile, |
| 81 | })) |
| 82 | } |
| 83 | |
| 84 | return patch.String() |
| 85 | } |
| 86 | |
| 87 | func (p *PatchBuilder) addFileWhole(info *fileInfo) { |
| 88 | if info.mode != WHOLE { |
no test coverage detected