- if (!commit2 || parse_commit(commit2))
- cgit_print_error(fmt("Bad commit: %s", sha1_to_hex(old_rev_sha1)));
+ if (!commit2 || parse_commit(commit2)) {
+ cgit_print_error("Bad commit: %s", sha1_to_hex(old_rev_sha1));
+ return;
+ }
+ }
+
+ if (raw) {
+ ctx.page.mimetype = "text/plain";
+ cgit_print_http_headers(&ctx);
+ cgit_diff_tree(old_rev_sha1, new_rev_sha1, filepair_cb_raw,
+ prefix, 0);
+ return;