Diff options
authorBryce Kwon <bryce@brycekwon.com>
committerBryce 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-snapshot.c')
-rw-r--r--source/ui-snapshot.c8
1 file changed, 1 insertion, 7 deletions
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.