From 4bf7dacfa870fb1fb81edf647fd5c049786c3c2f Mon Sep 17 00:00:00 2001 From: patrick-scho Date: Mon, 1 Dec 2025 15:12:11 +0100 Subject: print readme by oid try 1 --- ui-blob.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'ui-blob.c') diff --git a/ui-blob.c b/ui-blob.c index f76c641..3267ed1 100644 --- a/ui-blob.c +++ b/ui-blob.c @@ -65,6 +65,24 @@ done: return walk_tree_ctx.found_path; } +int cgit_print_oid(const struct object_id *oid) +{ + enum object_type type; + char *buf; + unsigned long size; + + type = oid_object_info(the_repository, oid, &size); + if (type == OBJ_BAD) + return -1; + buf = read_object_file(oid, &type, &size); + if (!buf) + return -1; + buf[size] = '\0'; + html_raw(buf, size); + free(buf); + return 0; +} + int cgit_print_file(char *path, const char *head, int file_only) { struct object_id oid; -- cgit v1.2.3