diff options
Diffstat (limited to 'ui-commit.c')
| -rw-r--r-- | ui-commit.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ui-commit.c b/ui-commit.c index d5a888d..2bca7a0 100644 --- a/ui-commit.c +++ b/ui-commit.c | |||
| @@ -27,12 +27,14 @@ void cgit_print_commit(char *hex, const char *prefix) | |||
| 27 | hex = ctx.qry.head; | 27 | hex = ctx.qry.head; |
| 28 | 28 | ||
| 29 | if (get_sha1(hex, sha1)) { | 29 | if (get_sha1(hex, sha1)) { |
| 30 | cgit_print_error("Bad object id: %s", hex); | 30 | cgit_print_error_page(400, "Bad request", |
| 31 | "Bad object id: %s", hex); | ||
| 31 | return; | 32 | return; |
| 32 | } | 33 | } |
| 33 | commit = lookup_commit_reference(sha1); | 34 | commit = lookup_commit_reference(sha1); |
| 34 | if (!commit) { | 35 | if (!commit) { |
| 35 | cgit_print_error("Bad commit reference: %s", hex); | 36 | cgit_print_error_page(404, "Not found", |
| 37 | "Bad commit reference: %s", hex); | ||
| 36 | return; | 38 | return; |
| 37 | } | 39 | } |
| 38 | info = cgit_parse_commit(commit); | 40 | info = cgit_parse_commit(commit); |
| @@ -41,6 +43,7 @@ void cgit_print_commit(char *hex, const char *prefix) | |||
| 41 | 43 | ||
| 42 | load_ref_decorations(DECORATE_FULL_REFS); | 44 | load_ref_decorations(DECORATE_FULL_REFS); |
| 43 | 45 | ||
| 46 | cgit_print_layout_start(); | ||
| 44 | cgit_print_diff_ctrls(); | 47 | cgit_print_diff_ctrls(); |
| 45 | html("<table summary='commit info' class='commit-info'>\n"); | 48 | html("<table summary='commit info' class='commit-info'>\n"); |
| 46 | html("<tr><th>author</th><td>"); | 49 | html("<tr><th>author</th><td>"); |
| @@ -139,4 +142,5 @@ void cgit_print_commit(char *hex, const char *prefix) | |||
| 139 | } | 142 | } |
| 140 | strbuf_release(¬es); | 143 | strbuf_release(¬es); |
| 141 | cgit_free_commitinfo(info); | 144 | cgit_free_commitinfo(info); |
| 145 | cgit_print_layout_end(); | ||
| 142 | } | 146 | } |
