Change-Id: I7f326b4fc96198de7b424e15d8329bde7d7b39cf
Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
.setURI(uri)
.call()
.getRepository();
+ try {
+ return readFileFromRepo(repo, ref, path);
+ } finally {
+ FileUtils.delete(dir, FileUtils.RECURSIVE);
+ }
+ }
+
+ protected byte[] readFileFromRepo(Repository repo,
+ String ref, String path) throws GitAPIException, IOException {
ObjectReader reader = repo.newObjectReader();
byte[] result;
try {
result = reader.open(oid).getBytes(Integer.MAX_VALUE);
} finally {
reader.release();
- FileUtils.delete(dir, FileUtils.RECURSIVE);
}
return result;
}