No longer access the global curr_rev variable in print_object().
This will make it easier to squash the curr_rev variable into a context
structure without having to pass the context to the print_object()
function.
Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
-static void print_object(const unsigned char *sha1, char *path, const char *basename)
+static void print_object(const unsigned char *sha1, char *path, const char *basename, const char *rev)
{
enum object_type type;
char *buf;
{
enum object_type type;
char *buf;
htmlf("blob: %s (", sha1_to_hex(sha1));
cgit_plain_link("plain", NULL, NULL, ctx.qry.head,
htmlf("blob: %s (", sha1_to_hex(sha1));
cgit_plain_link("plain", NULL, NULL, ctx.qry.head,
html(")\n");
if (ctx.cfg.max_blob_size && size / 1024 > ctx.cfg.max_blob_size) {
html(")\n");
if (ctx.cfg.max_blob_size && size / 1024 > ctx.cfg.max_blob_size) {
ls_head();
return READ_TREE_RECURSIVE;
} else {
ls_head();
return READ_TREE_RECURSIVE;
} else {
- print_object(sha1, buffer, pathname);
+ print_object(sha1, buffer, pathname, curr_rev);