(plain bool)
| 208 | } |
| 209 | |
| 210 | func (p *PatchBuilder) renderEachFilePatch(plain bool) []string { |
| 211 | // sort files by name then iterate through and render each patch |
| 212 | filenames := maps.Keys(p.fileInfoMap) |
| 213 | |
| 214 | sort.Strings(filenames) |
| 215 | patches := lo.Map(filenames, func(filename string, _ int) string { |
| 216 | return p.RenderPatchForFile(RenderPatchForFileOpts{ |
| 217 | Filename: filename, |
| 218 | Plain: plain, |
| 219 | Reverse: false, |
| 220 | TurnAddedFilesIntoDiffAgainstEmptyFile: true, |
| 221 | }) |
| 222 | }) |
| 223 | output := lo.Filter(patches, func(patch string, _ int) bool { |
| 224 | return patch != "" |
| 225 | }) |
| 226 | |
| 227 | return output |
| 228 | } |
| 229 | |
| 230 | func (p *PatchBuilder) RenderAggregatedPatch(plain bool) string { |
| 231 | return strings.Join(p.renderEachFilePatch(plain), "") |
no test coverage detected