ui-tree.c: Pass current revision to print_object()
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>
This commit is contained in:
부모
b1db30cd25
커밋
fb5a37317d
@ -84,7 +84,7 @@ static void print_binary_buffer(char *buf, unsigned long size)
|
|||||||
html("</table>\n");
|
html("</table>\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
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;
|
enum object_type type;
|
||||||
char *buf;
|
char *buf;
|
||||||
@ -106,7 +106,7 @@ static void print_object(const unsigned char *sha1, char *path, const char *base
|
|||||||
|
|
||||||
htmlf("blob: %s (", sha1_to_hex(sha1));
|
htmlf("blob: %s (", sha1_to_hex(sha1));
|
||||||
cgit_plain_link("plain", NULL, NULL, ctx.qry.head,
|
cgit_plain_link("plain", NULL, NULL, ctx.qry.head,
|
||||||
curr_rev, path);
|
rev, path);
|
||||||
html(")\n");
|
html(")\n");
|
||||||
|
|
||||||
if (ctx.cfg.max_blob_size && size / 1024 > ctx.cfg.max_blob_size) {
|
if (ctx.cfg.max_blob_size && size / 1024 > ctx.cfg.max_blob_size) {
|
||||||
@ -237,7 +237,7 @@ static int walk_tree(const unsigned char *sha1, const char *base, int baselen,
|
|||||||
ls_head();
|
ls_head();
|
||||||
return READ_TREE_RECURSIVE;
|
return READ_TREE_RECURSIVE;
|
||||||
} else {
|
} else {
|
||||||
print_object(sha1, buffer, pathname);
|
print_object(sha1, buffer, pathname, curr_rev);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
불러오는 중...
Reference in New Issue
Block a user