@@ -47,23 +47,22 @@ public static void write(UnifiedDiff diff, Function<String, List<String>> origin
47
47
writer .accept (diff .getHeader ());
48
48
49
49
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
-
63
50
List <AbstractDelta <String >> patchDeltas = new ArrayList <>(
64
51
file .getPatch ().getDeltas ());
65
-
66
52
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
+
67
66
List <AbstractDelta <String >> deltas = new ArrayList <>();
68
67
69
68
AbstractDelta <String > delta = patchDeltas .get (0 );
0 commit comments