From 702fd5d5d7a3c981856b711d785c44f65f8b9da6 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Fri, 30 Oct 2026 22:51:19 -0700 Subject: 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. --- source/ui-snapshot.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'source/ui-snapshot.c') diff --git a/source/ui-snapshot.c b/source/ui-snapshot.c index 2fa121f..333bce6 100644 --- a/source/ui-snapshot.c +++ b/source/ui-snapshot.c @@ -224,14 +224,8 @@ static void send_snapshot(const struct cgit_snapshot_format *format, const char { struct object_id oid; - if (repo_get_oid(the_repository, hex, &oid)) { - cgit_print_error_page(404, "Not Found", "Bad object id: %s", hex); + if (!cgit_get_commit(hex, &oid)) return; - } - if (!lookup_commit_reference(the_repository, &oid)) { - cgit_print_error_page(404, "Not Found", "Not a commit: %s", hex); - return; - } // A compressor that cannot run only shows up as a broken pipe once // the tar is under way, so it is looked for while a status can still // say so. -- cgit 2.12.1