aboutsummaryrefslogtreecommitdiff
path: root/ui-plain.c
diff refs
from: back
to: back
| flip
diff options
context:
space:
mode:
Diffstat (limited to 'ui-plain.c')
-rw-r--r--ui-plain.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/ui-plain.c b/ui-plain.c
index a2a4087..65a205f 100644
--- a/ui-plain.c
+++ b/ui-plain.c
@@ -6,8 +6,6 @@
* (see COPYING for full license text)
*/
-#define USE_THE_REPOSITORY_VARIABLE
-
#include "cgit.h"
#include "ui-plain.h"
#include "html.h"
@@ -24,13 +22,13 @@ static int print_object(const struct object_id *oid, const char *path)
char *buf, *mimetype;
unsigned long size;
- type = odb_read_object_info(the_repository->objects, oid, &size);
+ type = oid_object_info(the_repository, oid, &size);
if (type == OBJ_BAD) {
cgit_print_error_page(404, "Not found", "Not found");
return 0;
}
- buf = odb_read_object(the_repository->objects, oid, &type, &size);
+ buf = read_object_file(oid, &type, &size);
if (!buf) {
cgit_print_error_page(404, "Not found", "Not found");
return 0;
@@ -157,7 +155,7 @@ static int walk_tree(const struct object_id *oid, struct strbuf *base,
static int basedir_len(const char *path)
{
- const char *p = strrchr(path, '/');
+ char *p = strrchr(path, '/');
if (p)
return p - path + 1;
return 0;
@@ -183,12 +181,12 @@ void cgit_print_plain(void)
if (!rev)
rev = ctx.qry.head;
- if (repo_get_oid(the_repository, rev, &oid)) {
+ if (get_oid(rev, &oid)) {
cgit_print_error_page(404, "Not found", "Not found");
return;
}
commit = lookup_commit_reference(the_repository, &oid);
- if (!commit || repo_parse_commit(the_repository, commit)) {
+ if (!commit || parse_commit(commit)) {
cgit_print_error_page(404, "Not found", "Not found");
return;
}