@@ -47,23 +47,22 @@ public static void write(UnifiedDiff diff, Function<String, List<String>> origin
4747 writer .accept (diff .getHeader ());
4848
4949 for (UnifiedDiffFile file : diff .getFiles ()) {
50- writeOrNothing (writer , file .getDiffCommand ());
51- if (file .getIndex () != null ) {
52- writer .accept ("index " + file .getIndex ());
53- }
54- if (file .getFromFile () != null ) {
55- writer .accept ("--- " + file .getFromFile ());
56- }
57- if (file .getToFile () != null ) {
58- writer .accept ("+++ " + file .getToFile ());
59- }
60-
61- List <String > originalLines = originalLinesProvider .apply (file .getFromFile ());
62-
6350 List <AbstractDelta <String >> patchDeltas = new ArrayList <>(
6451 file .getPatch ().getDeltas ());
65-
6652 if (!patchDeltas .isEmpty ()) {
53+ writeOrNothing (writer , file .getDiffCommand ());
54+ if (file .getIndex () != null ) {
55+ writer .accept ("index " + file .getIndex ());
56+ }
57+ if (file .getFromFile () != null ) {
58+ writer .accept ("--- " + file .getFromFile ());
59+ }
60+ if (file .getToFile () != null ) {
61+ writer .accept ("+++ " + file .getToFile ());
62+ }
63+
64+ List <String > originalLines = originalLinesProvider .apply (file .getFromFile ());
65+
6766 List <AbstractDelta <String >> deltas = new ArrayList <>();
6867
6968 AbstractDelta <String > delta = patchDeltas .get (0 );
0 commit comments