summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorGeorg Müller2012-01-03 15:30:50 +0000
committerLars Hjemli2012-01-03 15:35:06 +0000
commit0b6a716d1b9f18e8cc00940a7962e542b9358238 (patch)
tree7fa04f27c6702de2b2a0bc7752a3204250696fba
parent7530d94f05887b8065742adb614c368d8568a22c (diff)
downloadcgit-0b6a716d1b9f18e8cc00940a7962e542b9358238.tar.gz
ui-log.c: do not show remote heads if enable-remote-branches=0
If remote branches are not enabled, the branches are still listed in the log view. This patch removes them if enable-remote-branches=0.
-rw-r--r--ui-log.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ui-log.c b/ui-log.c
index 15ed6a3..b67c2ef 100644
--- 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;
}
}