Enable default value for head parameter

Pages which expect head to be specified in the querystring can now be
given a default value, configurable per repository (via repo.defbranch,
which defaults to "master").

Currently, only the log page actually works without parameters, but the
defbranch is bound to be exploited.

This also removes some dead code from shared.c

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
这个提交包含在:
Lars Hjemli
2007-05-16 00:14:51 +02:00
父节点 47a81c77fd
当前提交 b28b105ec1
修改 3 个文件,包含 7 行新增14 行删除

3
cgit.c
查看文件

@@ -65,6 +65,9 @@ static void cgit_print_repo_page(struct cacheitem *item)
char *title;
int show_search;
if (!cgit_query_head)
cgit_query_head = cgit_repo->defbranch;
if (chdir(cgit_repo->path)) {
title = fmt("%s - %s", cgit_root_title, "Bad request");
cgit_print_docstart(title, item);