Diff options
authorBryce Kwon <bryce@brycekwon.com>
committerBryce Kwon <bryce@brycekwon.com>
commit
parent
tree
download
Drop the defaults the memset already sets
prepare_context zeroes the whole context first, and the repository list is a global, so neither needs its zeros written out again.
Diffstat (limited to 'source/cgit.c')
-rw-r--r--source/cgit.c17
1 file changed, 0 insertions, 17 deletions
diff --git a/source/cgit.c b/source/cgit.c
index 3788d8a..fb28816 100644
--- a/source/cgit.c
+++ b/source/cgit.c
@@ -95,7 +95,6 @@ static void prepare_context(void)
memset(&ctx, 0, sizeof(ctx));
ctx.cfg.agefile = "info/web/last-modified";
- ctx.cfg.cache_size = 0;
ctx.cfg.cache_root = CGIT_CACHE_ROOT;
ctx.cfg.cache_about_ttl = 15;
ctx.cfg.cache_snapshot_ttl = 5;
@@ -108,11 +107,8 @@ static void prepare_context(void)
// is served but not kept.
ctx.cfg.cache_max_slot_size = 64 * 1024;
ctx.cfg.case_sensitive_sort = 1;
- ctx.cfg.branch_sort = 0;
- ctx.cfg.commit_sort = 0;
ctx.cfg.logo = "/cgit.png";
ctx.cfg.favicon = "/favicon.ico";
- ctx.cfg.local_time = 0;
ctx.cfg.date_mode = date_mode_from_type(DATE_SHORT);
ctx.cfg.enable_header = 1;
ctx.cfg.enable_mailmap = 1;
@@ -121,7 +117,6 @@ static void prepare_context(void)
ctx.cfg.enable_http_clone = 1;
ctx.cfg.enable_index_owner = 1;
ctx.cfg.enable_tree_linenumbers = 1;
- ctx.cfg.enable_git_config = 0;
ctx.cfg.max_repo_count = 50;
ctx.cfg.max_commit_count = 50;
ctx.cfg.max_patch_count = 50;
@@ -133,23 +128,17 @@ static void prepare_context(void)
// Counted in kilobytes, so ten megabytes, which bounds the memory one
// request can be made to allocate for a blob.
ctx.cfg.max_blob_size = 10 * 1024;
- ctx.cfg.max_stats = 0;
- ctx.cfg.project_list = NULL;
ctx.cfg.renamelimit = -1;
- ctx.cfg.remove_suffix = 0;
ctx.cfg.robots = "index, nofollow";
ctx.cfg.root_title = "Git repository browser";
ctx.cfg.root_desc = "a fast webinterface for the git dscm";
- ctx.cfg.scan_hidden_path = 0;
ctx.cfg.script_name = CGIT_SCRIPT_NAME;
ctx.cfg.section = "";
ctx.cfg.repository_sort = "name";
- ctx.cfg.section_sort = 0;
ctx.cfg.summary_branches = 10;
ctx.cfg.summary_log = 10;
ctx.cfg.summary_tags = 10;
ctx.cfg.max_atom_items = 10;
- ctx.cfg.difftype = DIFF_UNIFIED;
ctx.env.cgit_config = getenv("CGIT_CONFIG");
ctx.env.http_host = getenv("HTTP_HOST");
ctx.env.https = getenv("HTTPS");
@@ -163,11 +152,8 @@ static void prepare_context(void)
ctx.env.http_referer = getenv("HTTP_REFERER");
ctx.env.content_length =
getenv("CONTENT_LENGTH") ? strtoul(getenv("CONTENT_LENGTH"), NULL, 10) : 0;
- ctx.env.authenticated = 0;
ctx.page.mimetype = "text/html";
ctx.page.charset = PAGE_ENCODING;
- ctx.page.filename = NULL;
- ctx.page.size = 0;
string_list_init_dup(&ctx.cfg.mimetypes);
if (script_name)
ctx.cfg.script_name = xstrdup(script_name);
@@ -1316,9 +1302,6 @@ int cmd_main(int argc, const char **argv)
set_die_routine(die_routine);
prepare_context();
- cgit_repolist.length = 0;
- cgit_repolist.count = 0;
- cgit_repolist.repos = NULL;
parse_args(argc, argv);
config_file_parse(cgit_expand_macros(ctx.env.cgit_config), apply_config);