]> git.cameronkatri.com Git - cgit.git/commitdiff
ui-log.c: do not show remote heads if enable-remote-branches=0
authorGeorg Müller <georgmueller@gmx.net>
Tue, 3 Jan 2012 15:30:50 +0000 (15:30 +0000)
committerLars Hjemli <hjemli@gmail.com>
Tue, 3 Jan 2012 15:35:06 +0000 (15:35 +0000)
If remote branches are not enabled, the branches are still listed in
the log view. This patch removes them if enable-remote-branches=0.

ui-log.c

index 15ed6a3f63dabea9cad60ae645b1450178dc274e..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/")) {
+                       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),
@@ -88,6 +90,7 @@ void show_commit_decorations(struct commit *commit)
                                         sha1_to_hex(commit->object.sha1),
                                         ctx.qry.vpath, 0);
                }
+next:
                deco = deco->next;
        }
 }