diff options
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; |
