]> gitweb.ps.run Git - ps-cgit/blobdiff - ui-log.c
ui-log.c: do not show remote heads if enable-remote-branches=0
[ps-cgit] / ui-log.c
index 8add66aa0f41c16081a2ead29ba2c19a8f41ace5..b67c2ef279059130df10ea3f45cccc20964c610a 100644 (file)
--- a/ui-log.c
+++ b/ui-log.c
@@ -76,6 +76,8 @@ void show_commit_decorations(struct commit *commit)
                        cgit_tag_link(buf, NULL, "tag-deco", ctx.qry.head, buf);
                }
                else if (!prefixcmp(deco->name, "refs/remotes/")) {
                        cgit_tag_link(buf, NULL, "tag-deco", ctx.qry.head, buf);
                }
                else if (!prefixcmp(deco->name, "refs/remotes/")) {
+                       if (!ctx.repo->enable_remote_branches)
+                               goto next;
                        strncpy(buf, deco->name + 13, sizeof(buf) - 1);
                        cgit_log_link(buf, NULL, "remote-deco", NULL,
                                      sha1_to_hex(commit->object.sha1),
                        strncpy(buf, deco->name + 13, sizeof(buf) - 1);
                        cgit_log_link(buf, NULL, "remote-deco", NULL,
                                      sha1_to_hex(commit->object.sha1),
@@ -88,6 +90,7 @@ void show_commit_decorations(struct commit *commit)
                                         sha1_to_hex(commit->object.sha1),
                                         ctx.qry.vpath, 0);
                }
                                         sha1_to_hex(commit->object.sha1),
                                         ctx.qry.vpath, 0);
                }
+next:
                deco = deco->next;
        }
 }
                deco = deco->next;
        }
 }
@@ -95,7 +98,6 @@ void show_commit_decorations(struct commit *commit)
 void print_commit(struct commit *commit, struct rev_info *revs)
 {
        struct commitinfo *info;
 void print_commit(struct commit *commit, struct rev_info *revs)
 {
        struct commitinfo *info;
-       char *tmp;
        int cols = revs->graph ? 3 : 2;
        struct strbuf graphbuf = STRBUF_INIT;
        struct strbuf msgbuf = STRBUF_INIT;
        int cols = revs->graph ? 3 : 2;
        struct strbuf graphbuf = STRBUF_INIT;
        struct strbuf msgbuf = STRBUF_INIT;
@@ -130,11 +132,7 @@ void print_commit(struct commit *commit, struct rev_info *revs)
        }
        else {
                html("<td>");
        }
        else {
                html("<td>");
-               tmp = fmt("id=%s", sha1_to_hex(commit->object.sha1));
-               tmp = cgit_fileurl(ctx.repo->url, "commit", ctx.qry.vpath, tmp);
-               html_link_open(tmp, NULL, NULL);
                cgit_print_age(commit->date, TM_WEEK * 2, FMT_SHORTDATE);
                cgit_print_age(commit->date, TM_WEEK * 2, FMT_SHORTDATE);
-               html_link_close();
                html("</td>");
        }
 
                html("</td>");
        }
 
@@ -172,11 +170,7 @@ void print_commit(struct commit *commit, struct rev_info *revs)
 
        if (revs->graph) {
                html("</td><td>");
 
        if (revs->graph) {
                html("</td><td>");
-               tmp = fmt("id=%s", sha1_to_hex(commit->object.sha1));
-               tmp = cgit_fileurl(ctx.repo->url, "commit", ctx.qry.vpath, tmp);
-               html_link_open(tmp, NULL, NULL);
                cgit_print_age(commit->date, TM_WEEK * 2, FMT_SHORTDATE);
                cgit_print_age(commit->date, TM_WEEK * 2, FMT_SHORTDATE);
-               html_link_close();
        }
 
        if (ctx.repo->enable_log_filecount) {
        }
 
        if (ctx.repo->enable_log_filecount) {