+ old_tree_sha1 = commit2->tree->object.sha1;
+ } else {
+ old_tree_sha1 = NULL;
+ }
+
+ if (raw) {
+ struct diff_options diffopt;
+
+ diff_setup(&diffopt);
+ diffopt.output_format = DIFF_FORMAT_PATCH;
+ DIFF_OPT_SET(&diffopt, RECURSIVE);
+ diff_setup_done(&diffopt);
+
+ ctx.page.mimetype = "text/plain";
+ cgit_print_http_headers(&ctx);
+ if (old_tree_sha1) {
+ diff_tree_sha1(old_tree_sha1, new_tree_sha1, "",
+ &diffopt);
+ } else {
+ diff_root_tree_sha1(new_tree_sha1, "", &diffopt);
+ }
+ diffcore_std(&diffopt);
+ diff_flush(&diffopt);
+
+ return;