]> git.cameronkatri.com Git - cgit.git/blobdiff - ui-commit.c
Do not alter incoming sha1 when handling the download refs.
[cgit.git] / ui-commit.c
index b3d1c28c2c188b7a2357058582cf9db8095348ed..b6a106fb0681a9e93638787f54443dff93dc17f8 100644 (file)
@@ -8,11 +8,11 @@
 
 #include "cgit.h"
 
-int files = 0, slots = 0;
-int total_adds = 0, total_rems = 0, max_changes = 0;
-int lines_added, lines_removed;
+static int files, slots;
+static int total_adds, total_rems, max_changes;
+static int lines_added, lines_removed;
 
-struct fileinfo {
+static struct fileinfo {
        char status;
        unsigned char old_sha1[20];
        unsigned char new_sha1[20];
@@ -186,7 +186,8 @@ void cgit_print_commit(const char *hex)
        cgit_print_date(info->committer_date);
        html("</td></tr>\n");
        html("<tr><th>tree</th><td colspan='2' class='sha1'><a href='");
-       query = fmt("id=%s", sha1_to_hex(commit->tree->object.sha1));
+       query = fmt("h=%s&id=%s", sha1_to_hex(commit->object.sha1),
+                   sha1_to_hex(commit->tree->object.sha1));
        html_attr(cgit_pageurl(cgit_query_repo, "tree", query));
        htmlf("'>%s</a></td></tr>\n", sha1_to_hex(commit->tree->object.sha1));
        for (p = commit->parents; p ; p = p->next) {