Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Look up a request's commit in one place
The diff page now names a revision that is no commit the way the
request wrote it, as the other pages already did, rather than as the
full id it resolved to. The helpers sit beside the error page in
ui-shared.c, since shared.c prints nothing.
Diffstat (limited to 'source/ui-commit.c')
| -rw-r--r-- | source/ui-commit.c | 10 |
1 file changed, 2 insertions, 8 deletions
diff --git a/source/ui-commit.c b/source/ui-commit.c index 9b2f8b9..c290a2c 100644 --- a/source/ui-commit.c +++ b/source/ui-commit.c @@ -251,15 +251,9 @@ void cgit_print_commit(char *hex, const char *prefix) if (!hex) hex = ctx.qry.head; - if (repo_get_oid(the_repository, hex, &oid)) { - cgit_print_error_page(404, "Not Found", "Bad object id: %s", hex); + commit = cgit_get_commit(hex, &oid); + if (!commit) return; - } - commit = lookup_commit_reference(the_repository, &oid); - if (!commit) { - cgit_print_error_page(404, "Not Found", "Not a commit: %s", hex); - return; - } info = cgit_parse_commit(commit); format_display_notes(&commit->object.oid, ¬es, PAGE_ENCODING, 1); |
