]> gitweb.ps.run Git - ps-cgit/blobdiff - ui-summary.c
Add git_log_link() and fix bug in generic repolink function
[ps-cgit] / ui-summary.c
index 5c1fc33d603fe2298d3ef3e48e5879b465500f20..29b76e368366469353b311a7a8b2a3cc5cfd333c 100644 (file)
@@ -19,14 +19,13 @@ static int cgit_print_branch_cb(const char *refname, const unsigned char *sha1,
 
        strncpy(buf, refname, sizeof(buf));
        commit = lookup_commit(sha1);
+       // object is not really parsed at this point, because of some fallout
+       // from previous calls to git functions in cgit_print_log()
+       commit->object.parsed = 0;
        if (commit && !parse_commit(commit)){
                info = cgit_parse_commit(commit);
                html("<tr><td>");
-               url = cgit_pageurl(cgit_query_repo, "log",
-                                  fmt("h=%s", refname));
-               html_link_open(url, NULL, NULL);
-               html_txt(buf);
-               html_link_close();
+               cgit_log_link(refname, NULL, NULL, refname, NULL, NULL);
                html("</td><td>");
                cgit_print_age(commit->date, -1, NULL);
                html("</td><td>");
@@ -159,12 +158,12 @@ static int cgit_print_archive_cb(const char *refname, const unsigned char *sha1,
        }
        html("<tr><td>");
        url = cgit_pageurl(cgit_query_repo, "blob",
-                          fmt("id=%s&path=%s", sha1_to_hex(fileid),
+                          fmt("id=%s&amp;path=%s", sha1_to_hex(fileid),
                               buf));
        html_link_open(url, NULL, NULL);
        html_txt(buf);
        html_link_close();
-       html("</td><tr>");
+       html("</td></tr>");
        return 0;
 }
 
@@ -203,8 +202,11 @@ void cgit_print_summary()
        if (cgit_repo->readme)
                html_include(cgit_repo->readme);
        html("</div>");
-
+       if (cgit_summary_log > 0)
+               cgit_print_log(cgit_query_head, 0, cgit_summary_log, NULL, NULL, 0);
        html("<table class='list nowrap'>");
+       if (cgit_summary_log > 0)
+               html("<tr class='nohover'><td colspan='4'>&nbsp;</td></tr>");
        cgit_print_branches();
        html("<tr class='nohover'><td colspan='4'>&nbsp;</td></tr>");
        cgit_print_tags();