{"schema":"libjg2-1",
"vpath":"/git/",
"avatar":"/git/avatar/",
"alang":"",
"gen_ut":1745908060,
"reponame":"cgit",
"desc":"CGI gitweb",
"owner": { "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" },"url":"https://warmcat.com/repo/cgit",
"f":3,
"items": [
{"schema":"libjg2-1",
"cid":"d3a9fad4c334b62a644f86d73aa0acf9",
"commit": {"type":"commit",
"time": 1530589970,
"time_ofs": 480,
"oid_tree": { "oid": "adeb4f7e1f3ba291e84c49d668ab75fdc34f1ceb", "alias": []},
"oid":{ "oid": "c3eedcdfd64e26a0855b92e25393e979ad982033", "alias": []},
"msg": "ui-tree: print_buffer() and include_file()",
"sig_commit": { "git_time": { "time": 1530589970, "offset": 480 }, "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" },
"sig_author": { "git_time": { "time": 1530580215, "offset": 480 }, "name": "John Keeping", "email": "john@keeping.me.uk", "md5": "aea7d8738c91da1cb0dfa9d86f2bbc47" }},
"body": "ui-tree: print_buffer() and include_file()\n\nThis used to be the following patch from John Keeping:\n\nui-tree: use render filters to display content\n\nAG stripped this down to just print_buffer() and\ninclude_file()\n\nSigned-off-by: John Keeping \u003cjohn@keeping.me.uk\u003e\nSigned-off-by: Andy Green \u003candy@warmcat.com\u003e"
,
"diff": "diff --git a/ui-tree.c b/ui-tree.c\nindex 6a00b76..98d39ce 100644\n--- a/ui-tree.c\n+++ b/ui-tree.c\n@@ -84,7 +84,65 @@ static void print_binary_buffer(char *buf, unsigned long size)\n \thtml(\u0022\u003c/table\u003e\u005cn\u0022);\n }\n \n-static void print_object(const struct object_id *oid, char *path, const char *basename, const char *rev)\n+static void print_buffer(const char *basename, char *buf, unsigned long size)\n+{\n+\tif (ctx.cfg.max_blob_size \u0026\u0026 size / 1024 \u003e ctx.cfg.max_blob_size) {\n+\t\thtmlf(\u0022\u003cdiv class\u003d'error'\u003eblob size (%ldKB) exceeds display size limit (%dKB).\u003c/div\u003e\u0022,\n+\t\t\t\tsize / 1024, ctx.cfg.max_blob_size);\n+\t\treturn;\n+\t}\n+\n+\tif (buffer_is_binary(buf, size))\n+\t\tprint_binary_buffer(buf, size);\n+\telse\n+\t\tprint_text_buffer(basename, buf, size);\n+}\n+\n+static void include_file(const char *path, const char *mimetype)\n+{\n+\tconst char *delim \u003d \u0022?\u0022;\n+\n+\thtml(\u0022\u003cdiv class\u003d'blob'\u003e\u0022);\n+\n+\tif (!strncmp(mimetype, \u0022image/\u0022, 6)) {\n+\t\thtml(\u0022\u003cimg alt\u003d'\u0022);\n+\t\thtml_attr(path);\n+\t\thtml(\u0022' src\u003d'\u0022);\n+\t} else {\n+\t\thtml(\u0022\u003ciframe sandbox\u003d'allow-scripts' src\u003d'\u0022);\n+\t}\n+\n+\tif (ctx.cfg.virtual_root) {\n+\t\thtml_url_path(ctx.cfg.virtual_root);\n+\t\thtml_url_path(ctx.repo-\u003eurl);\n+\t\tif (ctx.repo-\u003eurl[strlen(ctx.repo-\u003eurl) - 1] !\u003d '/')\n+\t\t\thtml(\u0022/\u0022);\n+\t\thtml(\u0022plain/\u0022);\n+\t\thtml_url_path(path);\n+\t} else {\n+\t\thtml_url_path(ctx.cfg.script_name);\n+\t\thtml(\u0022?url\u003d\u0022);\n+\t\thtml_url_arg(ctx.repo-\u003eurl);\n+\t\tif (ctx.repo-\u003eurl[strlen(ctx.repo-\u003eurl) - 1] !\u003d '/')\n+\t\t\thtml(\u0022/\u0022);\n+\t\thtml(\u0022plain/\u0022);\n+\t\tif (path)\n+\t\t\thtml_url_arg(path);\n+\t\tdelim \u003d \u0022\u0026\u0022;\n+\t}\n+\tif (ctx.qry.head \u0026\u0026 ctx.repo-\u003edefbranch \u0026\u0026\n+\t strcmp(ctx.qry.head, ctx.repo-\u003edefbranch)) {\n+\t\thtml(delim);\n+\t\thtml(\u0022h\u003d\u0022);\n+\t\thtml_url_arg(ctx.qry.head);\n+\t\tdelim \u003d \u0022\u0026\u0022;\n+\t}\n+\n+\thtml(\u0022'\u003e\u003c/div\u003e\u0022);\n+}\n+\n+static void print_object(const struct object_id *oid, char *path, const char *basename,\n+\t\t\t const char *rev)\n {\n \tenum object_type type;\n \tchar *buf;\n","s":{"c":1745908060,"u": 1833}}
],"g": 3279,"chitpc": 0,"ehitpc": 0,"indexed":0
,
"ab": 0, "si": 0, "db":0, "di":0, "sat":0, "lfc": "0000"}