]> gitweb.ps.run Git - ps-cgit/blobdiff - ui-commit.c
Use reflist to print branch info
[ps-cgit] / ui-commit.c
index 2679b59d7e5eabdf59cae0d9219b5cb2370c0832..4ac8955379b12f17fbb2c47cd5bea5299353dce2 100644 (file)
@@ -75,8 +75,8 @@ void print_fileinfo(struct fileinfo *info)
                html("]</span>");
        }
        htmlf("</td><td class='%s'>", class);
-       cgit_tree_link(info->new_path, NULL, NULL, cgit_query_head, curr_rev,
-                      info->new_path);
+       cgit_diff_link(info->new_path, NULL, NULL, cgit_query_head, curr_rev,
+                      NULL, info->new_path);
        if (info->status == DIFF_STATUS_COPIED || info->status == DIFF_STATUS_RENAMED)
                htmlf(" (%s from %s)",
                      info->status == DIFF_STATUS_COPIED ? "copied" : "renamed",
@@ -139,7 +139,6 @@ void cgit_print_commit(char *hex)
        struct commitinfo *info;
        struct commit_list *p;
        unsigned char sha1[20];
-       char *filename;
        char *tmp;
        int i;
 
@@ -196,11 +195,10 @@ void cgit_print_commit(char *hex)
                html(")</td></tr>");
        }
        if (cgit_repo->snapshots) {
-               htmlf("<tr><th>download</th><td colspan='2' class='sha1'><a href='");
-               filename = fmt("%s-%s.zip", cgit_query_repo, hex);
-               html_attr(cgit_pageurl(cgit_query_repo, "snapshot",
-                                      fmt("id=%s&amp;name=%s", hex, filename)));
-               htmlf("'>%s</a></td></tr>", filename);
+               html("<tr><th>download</th><td colspan='2' class='sha1'>");
+               cgit_print_snapshot_links(cgit_query_repo, cgit_query_head,
+                                         hex, cgit_repo->snapshots);
+               html("</td></tr>");
        }
        html("</table>\n");
        html("<div class='commit-subject'>");