walk.setTreeFilter(AndTreeFilter.create(PathFilterGroup.createFromStrings(Collections.singleton(pattern)), TreeFilter.ANY_DIFF));
RevCommit revCommit = walk.parseCommit(refId);
walk.dispose();
Commit commit = new Commit(null /* not needed */, db, revCommit, pattern);
ObjectStream stream = commit.toObjectStream();
if (stream == null) {
String msg = NLS.bind("Commit body for ref {0} not found", ref);
return statusHandler.handleRequest(request, response, new ServerStatus(IStatus.ERROR, HttpServletResponse.SC_NOT_FOUND, msg, null));
}
IOUtilities.pipe(stream, response.getOutputStream(), true, false);