TreeWalk.release() only release reader, so remove it
The code releases TreeWalk. This is not nesessary as the TreeWalk.release() only releases reader object. This is already done in RevWalk.release() method. Change-Id: I934ca374461d242ea999ccff8f46f00d6da7c411
This commit is contained in:
@@ -62,19 +62,15 @@ public class GetContent implements RestReadView<FileResource> {
|
||||
if (tw == null) {
|
||||
throw new ResourceNotFoundException();
|
||||
}
|
||||
try {
|
||||
final ObjectLoader object = repo.open(tw.getObjectId(0));
|
||||
@SuppressWarnings("resource")
|
||||
BinaryResult result = new BinaryResult() {
|
||||
@Override
|
||||
public void writeTo(OutputStream os) throws IOException {
|
||||
object.copyTo(os);
|
||||
}
|
||||
};
|
||||
return result.setContentLength(object.getSize()).base64();
|
||||
} finally {
|
||||
tw.release();
|
||||
}
|
||||
final ObjectLoader object = repo.open(tw.getObjectId(0));
|
||||
@SuppressWarnings("resource")
|
||||
BinaryResult result = new BinaryResult() {
|
||||
@Override
|
||||
public void writeTo(OutputStream os) throws IOException {
|
||||
object.copyTo(os);
|
||||
}
|
||||
};
|
||||
return result.setContentLength(object.getSize()).base64();
|
||||
} finally {
|
||||
rw.release();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user