Git git = new Git(db);
ApplyCommand applyCommand = git.apply();
applyCommand.setPatch(IOUtilities.toInputStream(patch));
// TODO: ignore all errors for now, see bug 366008
try {
ApplyResult applyResult = applyCommand.call();
JSONObject resp = new JSONObject();
JSONArray modifiedFieles = new JSONArray();
for (File file : applyResult.getUpdatedFiles()) {
modifiedFieles.put(stripGlobalPaths(db, file.getAbsolutePath()));
}