]> gitweb.ps.run Git - ps-cgit/blobdiff - ui-diff.c
Merge branch 'lh/panel'
[ps-cgit] / ui-diff.c
index b7767b3c07a23ea06e3aa3aab103fe3bf765cfe4..868ceec23b813f8dbd39b9eda8249131caa308e3 100644 (file)
--- 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))