if (Filepath.hasTrailingSeparator()) {
String msg = NLS.bind("Cannot get blame Information on a folder: {0}", requestInfo.filePath.toString());
return statusHandler.handleRequest(request, response, new ServerStatus(IStatus.ERROR, HttpServletResponse.SC_BAD_REQUEST, msg, null));
}
Blame blame = new Blame(cloneLocation, requestInfo.db);
String gitSegment = requestInfo.gitSegment;
if (!gitSegment.equalsIgnoreCase("HEAD") && !gitSegment.equalsIgnoreCase("master")) {
ObjectId id = ObjectId.fromString(requestInfo.gitSegment);
blame.setStartCommit(id);
}
String path = requestInfo.relativePath;
blame.setFilePath(path);
blame.setBlameLocation(getURI(request));
doBlame(blame, requestInfo.db);
OrionServlet.writeJSONResponse(request, response, blame.toJSON(), JsonURIUnqualificationStrategy.ALL_NO_GIT);
return true;
} catch (Exception e) {
return statusHandler.handleRequest(request, response, new ServerStatus(IStatus.ERROR, HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
"Error generating blame response", e));
}