]> gitweb.ps.run Git - ps-cgit/blobdiff - ui-tree.c
ui-tree.c: Pass current revision to print_object()
[ps-cgit] / ui-tree.c
index 4d7b2617ed0c8ae924a860acd4ec4164b10d73d2..305c95157d025401dca9a61263007c5a94e90379 100644 (file)
--- a/ui-tree.c
+++ b/ui-tree.c
@@ -30,7 +30,7 @@ static void print_text_buffer(const char *name, char *buf, unsigned long size)
 
                if (size) {
                        htmlf(numberfmt, ++lineno);
 
                if (size) {
                        htmlf(numberfmt, ++lineno);
-                       while(idx < size - 1) { // skip absolute last newline
+                       while (idx < size - 1) { // skip absolute last newline
                                if (buf[idx] == '\n')
                                        htmlf(numberfmt, ++lineno);
                                idx++;
                                if (buf[idx] == '\n')
                                        htmlf(numberfmt, ++lineno);
                                idx++;
@@ -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;
        char *buf;
 {
        enum object_type type;
        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));
        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,
-                       curr_rev, path);
+                       rev, path);
        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) {
@@ -237,7 +237,7 @@ static int walk_tree(const unsigned char *sha1, const char *base, int baselen,
                        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);
                        return 0;
                }
        }
                        return 0;
                }
        }