|
|
@ -173,7 +173,7 @@ public class DiffFormatter implements AutoCloseable { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void setRepository(Repository repository) { |
|
|
|
public void setRepository(Repository repository) { |
|
|
|
if (reader != null) |
|
|
|
if (reader != null) |
|
|
|
reader.release(); |
|
|
|
reader.close(); |
|
|
|
|
|
|
|
|
|
|
|
db = repository; |
|
|
|
db = repository; |
|
|
|
reader = db.newObjectReader(); |
|
|
|
reader = db.newObjectReader(); |
|
|
@ -422,10 +422,11 @@ public class DiffFormatter implements AutoCloseable { |
|
|
|
throws IOException { |
|
|
|
throws IOException { |
|
|
|
assertHaveRepository(); |
|
|
|
assertHaveRepository(); |
|
|
|
|
|
|
|
|
|
|
|
RevWalk rw = new RevWalk(reader); |
|
|
|
try (RevWalk rw = new RevWalk(reader)) { |
|
|
|
RevTree aTree = a != null ? rw.parseTree(a) : null; |
|
|
|
RevTree aTree = a != null ? rw.parseTree(a) : null; |
|
|
|
RevTree bTree = b != null ? rw.parseTree(b) : null; |
|
|
|
RevTree bTree = b != null ? rw.parseTree(b) : null; |
|
|
|
return scan(aTree, bTree); |
|
|
|
return scan(aTree, bTree); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|