diff options
| author | patrick-scho | 2025-12-01 15:12:11 +0100 |
|---|---|---|
| committer | patrick-scho | 2025-12-01 15:12:11 +0100 |
| commit | 4bf7dacfa870fb1fb81edf647fd5c049786c3c2f (patch) | |
| tree | 2b86ea0f899db22f467c82d13c37c01ee43abe11 /ui-blob.c | |
| parent | 7b3024b827a667c8a50260c679ebdb39ef4b937a (diff) | |
| download | ps-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.c | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -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; |
