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 |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/ui-log.c b/ui-log.c
index 4a295bd..64f90da 100644
--- a/ui-log.c
+++ b/ui-log.c
@@ -76,6 +76,10 @@ 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) {
+                               deco = deco->next;
+                               continue;
+                       }
                        strncpy(buf, deco->name + 13, sizeof(buf) - 1);
                        cgit_log_link(buf, NULL, "remote-deco", NULL,
                                      sha1_to_hex(commit->object.sha1),
-- 
1.7.4.1

_______________________________________________
cgit mailing list
[email protected]
http://hjemli.net/mailman/listinfo/cgit

Reply via email to