abouttreesummaryrefslogcommitdiff
path: root/ui-blob.c
diff options
context:
space:
mode:
authorpatrick-scho2025-12-01 15:12:11 +0100
committerpatrick-scho2025-12-01 15:12:11 +0100
commit4bf7dacfa870fb1fb81edf647fd5c049786c3c2f (patch)
tree2b86ea0f899db22f467c82d13c37c01ee43abe11 /ui-blob.c
parent7b3024b827a667c8a50260c679ebdb39ef4b937a (diff)
downloadps-cgit-4bf7dacfa870fb1fb81edf647fd5c049786c3c2f.tar.gz
ps-cgit-4bf7dacfa870fb1fb81edf647fd5c049786c3c2f.zip
print readme by oid try 1
Diffstat (limited to 'ui-blob.c')
-rw-r--r--ui-blob.c18
1 files changed, 18 insertions, 0 deletions
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;