|
diff --git a/ui-diff.c b/ui-diff.c index a7bc667..d21541b 100644 --- a/ ui-diff.c+++ b/ ui-diff.c |
|
@@ -344,10 +344,12 @@ void cgit_print_diff(const char *new_rev, const char *old_rev, const char *prefi |
344 | cgit_print_error(fmt("Bad object name: %s", new_rev)); |
344 | cgit_print_error(fmt("Bad object name: %s", new_rev)); |
345 | return; |
345 | return; |
346 | } |
346 | } |
347 | commit = lookup_commit_reference(new_rev_sha1); |
347 | commit = lookup_commit_reference(new_rev_sha1); |
348 | if (!commit || parse_commit(commit)) |
348 | if (!commit || parse_commit(commit)) { |
349 | cgit_print_error(fmt("Bad commit: %s", sha1_to_hex(new_rev_sha1))); |
349 | cgit_print_error(fmt("Bad commit: %s", sha1_to_hex(new_rev_sha1))); |
| |
350 | return; |
| |
351 | } |
350 | |
352 | |
351 | if (old_rev) |
353 | if (old_rev) |
352 | get_sha1(old_rev, old_rev_sha1); |
354 | get_sha1(old_rev, old_rev_sha1); |
353 | else if (commit->parents && commit->parents->item) |
355 | else if (commit->parents && commit->parents->item) |
@@ -361,10 +363,12 @@ void cgit_print_diff(const char *new_rev, const char *old_rev, const char *prefi |
361 | cgit_print_error(fmt("Bad object name: %s", sha1_to_hex(old_rev_sha1))); |
363 | cgit_print_error(fmt("Bad object name: %s", sha1_to_hex(old_rev_sha1))); |
362 | return; |
364 | return; |
363 | } |
365 | } |
364 | commit2 = lookup_commit_reference(old_rev_sha1); |
366 | commit2 = lookup_commit_reference(old_rev_sha1); |
365 | if (!commit2 || parse_commit(commit2)) |
367 | if (!commit2 || parse_commit(commit2)) { |
366 | cgit_print_error(fmt("Bad commit: %s", sha1_to_hex(old_rev_sha1))); |
368 | cgit_print_error(fmt("Bad commit: %s", sha1_to_hex(old_rev_sha1))); |
| |
369 | return; |
| |
370 | } |
367 | } |
371 | } |
368 | |
372 | |
369 | if ((ctx.qry.ssdiff && !ctx.cfg.ssdiff) || (!ctx.qry.ssdiff && ctx.cfg.ssdiff)) |
373 | if ((ctx.qry.ssdiff && !ctx.cfg.ssdiff) || (!ctx.qry.ssdiff && ctx.cfg.ssdiff)) |
370 | use_ssdiff = 1; |
374 | use_ssdiff = 1; |
|