X-Git-Url: https://gitweb.ps.run/ps-cgit/blobdiff_plain/1b5c336cc99f01a0f8d6668cbfc9273f49a6be25..2ffeecb7a6827dcf0f81cf543ed312155f6e8f83:/ui-diff.c?ds=sidebyside diff --git a/ui-diff.c b/ui-diff.c index b7767b3..868ceec 100644 --- a/ui-diff.c +++ b/ui-diff.c @@ -368,8 +368,10 @@ void cgit_print_diff(const char *new_rev, const char *old_rev, return; } commit = lookup_commit_reference(new_rev_sha1); - if (!commit || parse_commit(commit)) + if (!commit || parse_commit(commit)) { cgit_print_error(fmt("Bad commit: %s", sha1_to_hex(new_rev_sha1))); + return; + } if (old_rev) get_sha1(old_rev, old_rev_sha1); @@ -385,8 +387,10 @@ void cgit_print_diff(const char *new_rev, const char *old_rev, return; } commit2 = lookup_commit_reference(old_rev_sha1); - if (!commit2 || parse_commit(commit2)) + if (!commit2 || parse_commit(commit2)) { cgit_print_error(fmt("Bad commit: %s", sha1_to_hex(old_rev_sha1))); + return; + } } if ((ctx.qry.ssdiff && !ctx.cfg.ssdiff) || (!ctx.qry.ssdiff && ctx.cfg.ssdiff))