@@ -73,36 +73,50 @@ public boolean render(PatchDiff patchDiff, final Path directory, final RenderOpt
7373 return render (patchDiff .getDiffTree (), patchDiff , directory , options );
7474 }
7575
76+ public boolean render (PatchDiff patchDiff , final Path directory , final RenderOptions options , final DiffTreeLineGraphExportOptions exportOptions ) {
77+ return render (patchDiff .getDiffTree (), patchDiff , directory , options , exportOptions );
78+ }
79+
7680 public boolean render (final DiffTree tree , final GitPatch patch , final Path directory , final RenderOptions options ) {
7781 final String treeAndFileName =
7882 patch .getFileName ()
7983 + LineGraphConstants .TREE_NAME_SEPARATOR
8084 + patch .getCommitHash ();
81- return render (tree , treeAndFileName , directory , options );
85+ return render (tree , treeAndFileName , directory , options , options .toLineGraphOptions ());
86+ }
87+
88+ public boolean render (final DiffTree tree , final GitPatch patch , final Path directory , final RenderOptions options , final DiffTreeLineGraphExportOptions exportOptions ) {
89+ final String treeAndFileName =
90+ patch .getFileName ()
91+ + LineGraphConstants .TREE_NAME_SEPARATOR
92+ + patch .getCommitHash ();
93+ return render (tree , treeAndFileName , directory , options , exportOptions );
8294 }
8395
8496 public boolean render (final DiffTree tree , final String treeAndFileName , final Path directory ) {
8597 return render (tree , treeAndFileName , directory , RenderOptions .DEFAULT );
8698 }
8799
88100 public boolean render (final DiffTree tree , final String treeAndFileName , final Path directory , RenderOptions options ) {
89- return render (tree , treeAndFileName , directory , options ,
101+ return render (tree , treeAndFileName , directory , options , options .toLineGraphOptions ());
102+ }
103+
104+ public boolean render (final DiffTree tree , final String treeAndFileName , final Path directory , RenderOptions options , final DiffTreeLineGraphExportOptions exportOptions ) {
105+ return render (tree , treeAndFileName , directory , options , exportOptions ,
90106 (treeName , treeSource ) -> LineGraphConstants .LG_TREE_HEADER + " " + treeAndFileName + LineGraphConstants .TREE_NAME_SEPARATOR + "0"
91107 );
92108 }
93109
94110 public boolean renderWithTreeFormat (final DiffTree tree , final String treeAndFileName , final Path directory , RenderOptions options ) {
95- return render (tree , treeAndFileName , directory , options ,
111+ return render (tree , treeAndFileName , directory , options , options . toLineGraphOptions (),
96112 (treeName , treeSource ) -> options .treeFormat ().toLineGraphLine (treeSource )
97113 );
98114 }
99115
100- private boolean render (final DiffTree tree , final String treeAndFileName , final Path directory , RenderOptions options , BiFunction <String , DiffTreeSource , String > treeHeader ) {
101- final DiffTreeLineGraphExportOptions lgoptions = new DiffTreeLineGraphExportOptions (options .format (), options .treeFormat (), options .nodeFormat (), options .edgeFormat ());
102-
116+ private boolean render (final DiffTree tree , final String treeAndFileName , final Path directory , RenderOptions options , DiffTreeLineGraphExportOptions exportOptions , BiFunction <String , DiffTreeSource , String > treeHeader ) {
103117 final Path tempFile = directory .resolve (treeAndFileName + ".lg" );
104118
105- final Pair <DiffTreeSerializeDebugData , String > result = LineGraphExport .toLineGraphFormat (tree , lgoptions );
119+ final Pair <DiffTreeSerializeDebugData , String > result = LineGraphExport .toLineGraphFormat (tree , exportOptions );
106120 Assert .assertNotNull (result );
107121 final String lg = treeHeader .apply (treeAndFileName , tree .getSource ()) + StringUtils .LINEBREAK + result .second ();
108122
0 commit comments