|
diff --git a/cgit.c b/cgit.c index dbec196..7b228af 100644 --- a/ cgit.c+++ b/ cgit.c |
|
@@ -91,24 +91,26 @@ void config_cb(const char *name, const char *value) |
91 | else if (!strcmp(name, "cache-size")) |
91 | else if (!strcmp(name, "cache-size")) |
92 | ctx.cfg.cache_size = atoi(value); |
92 | ctx.cfg.cache_size = atoi(value); |
93 | else if (!strcmp(name, "cache-root")) |
93 | else if (!strcmp(name, "cache-root")) |
94 | ctx.cfg.cache_root = xstrdup(value); |
94 | ctx.cfg.cache_root = xstrdup(value); |
95 | else if (!strcmp(name, "cache-root-ttl")) |
95 | else if (!strcmp(name, "cache-root-ttl")) |
96 | ctx.cfg.cache_root_ttl = atoi(value); |
96 | ctx.cfg.cache_root_ttl = atoi(value); |
97 | else if (!strcmp(name, "cache-repo-ttl")) |
97 | else if (!strcmp(name, "cache-repo-ttl")) |
98 | ctx.cfg.cache_repo_ttl = atoi(value); |
98 | ctx.cfg.cache_repo_ttl = atoi(value); |
99 | else if (!strcmp(name, "cache-static-ttl")) |
99 | else if (!strcmp(name, "cache-static-ttl")) |
100 | ctx.cfg.cache_static_ttl = atoi(value); |
100 | ctx.cfg.cache_static_ttl = atoi(value); |
101 | else if (!strcmp(name, "cache-dynamic-ttl")) |
101 | else if (!strcmp(name, "cache-dynamic-ttl")) |
102 | ctx.cfg.cache_dynamic_ttl = atoi(value); |
102 | ctx.cfg.cache_dynamic_ttl = atoi(value); |
| |
103 | else if (!strcmp(name, "about-filter")) |
| |
104 | ctx.cfg.about_filter = new_filter(value, 0); |
103 | else if (!strcmp(name, "commit-filter")) |
105 | else if (!strcmp(name, "commit-filter")) |
104 | ctx.cfg.commit_filter = new_filter(value, 0); |
106 | ctx.cfg.commit_filter = new_filter(value, 0); |
105 | else if (!strcmp(name, "embedded")) |
107 | else if (!strcmp(name, "embedded")) |
106 | ctx.cfg.embedded = atoi(value); |
108 | ctx.cfg.embedded = atoi(value); |
107 | else if (!strcmp(name, "max-message-length")) |
109 | else if (!strcmp(name, "max-message-length")) |
108 | ctx.cfg.max_msg_len = atoi(value); |
110 | ctx.cfg.max_msg_len = atoi(value); |
109 | else if (!strcmp(name, "max-repodesc-length")) |
111 | else if (!strcmp(name, "max-repodesc-length")) |
110 | ctx.cfg.max_repodesc_len = atoi(value); |
112 | ctx.cfg.max_repodesc_len = atoi(value); |
111 | else if (!strcmp(name, "max-repo-count")) |
113 | else if (!strcmp(name, "max-repo-count")) |
112 | ctx.cfg.max_repo_count = atoi(value); |
114 | ctx.cfg.max_repo_count = atoi(value); |
113 | else if (!strcmp(name, "max-commit-count")) |
115 | else if (!strcmp(name, "max-commit-count")) |
114 | ctx.cfg.max_commit_count = atoi(value); |
116 | ctx.cfg.max_commit_count = atoi(value); |
@@ -149,24 +151,26 @@ void config_cb(const char *name, const char *value) |
149 | else if (ctx.repo && !strcmp(name, "repo.defbranch")) |
151 | else if (ctx.repo && !strcmp(name, "repo.defbranch")) |
150 | ctx.repo->defbranch = xstrdup(value); |
152 | ctx.repo->defbranch = xstrdup(value); |
151 | else if (ctx.repo && !strcmp(name, "repo.snapshots")) |
153 | else if (ctx.repo && !strcmp(name, "repo.snapshots")) |
152 | ctx.repo->snapshots = ctx.cfg.snapshots & cgit_parse_snapshots_mask(value); /* XXX: &? */ |
154 | ctx.repo->snapshots = ctx.cfg.snapshots & cgit_parse_snapshots_mask(value); /* XXX: &? */ |
153 | else if (ctx.repo && !strcmp(name, "repo.enable-log-filecount")) |
155 | else if (ctx.repo && !strcmp(name, "repo.enable-log-filecount")) |
154 | ctx.repo->enable_log_filecount = ctx.cfg.enable_log_filecount * atoi(value); |
156 | ctx.repo->enable_log_filecount = ctx.cfg.enable_log_filecount * atoi(value); |
155 | else if (ctx.repo && !strcmp(name, "repo.enable-log-linecount")) |
157 | else if (ctx.repo && !strcmp(name, "repo.enable-log-linecount")) |
156 | ctx.repo->enable_log_linecount = ctx.cfg.enable_log_linecount * atoi(value); |
158 | ctx.repo->enable_log_linecount = ctx.cfg.enable_log_linecount * atoi(value); |
157 | else if (ctx.repo && !strcmp(name, "repo.max-stats")) |
159 | else if (ctx.repo && !strcmp(name, "repo.max-stats")) |
158 | ctx.repo->max_stats = cgit_find_stats_period(value, NULL); |
160 | ctx.repo->max_stats = cgit_find_stats_period(value, NULL); |
159 | else if (ctx.repo && !strcmp(name, "repo.module-link")) |
161 | else if (ctx.repo && !strcmp(name, "repo.module-link")) |
160 | ctx.repo->module_link= xstrdup(value); |
162 | ctx.repo->module_link= xstrdup(value); |
| |
163 | else if (ctx.repo && !strcmp(name, "repo.about-filter")) |
| |
164 | ctx.repo->about_filter = new_filter(value, 0); |
161 | else if (ctx.repo && !strcmp(name, "repo.commit-filter")) |
165 | else if (ctx.repo && !strcmp(name, "repo.commit-filter")) |
162 | ctx.repo->commit_filter = new_filter(value, 0); |
166 | ctx.repo->commit_filter = new_filter(value, 0); |
163 | else if (ctx.repo && !strcmp(name, "repo.source-filter")) |
167 | else if (ctx.repo && !strcmp(name, "repo.source-filter")) |
164 | ctx.repo->source_filter = new_filter(value, 1); |
168 | ctx.repo->source_filter = new_filter(value, 1); |
165 | else if (ctx.repo && !strcmp(name, "repo.readme") && value != NULL) { |
169 | else if (ctx.repo && !strcmp(name, "repo.readme") && value != NULL) { |
166 | if (*value == '/') |
170 | if (*value == '/') |
167 | ctx.repo->readme = xstrdup(value); |
171 | ctx.repo->readme = xstrdup(value); |
168 | else |
172 | else |
169 | ctx.repo->readme = xstrdup(fmt("%s/%s", ctx.repo->path, value)); |
173 | ctx.repo->readme = xstrdup(fmt("%s/%s", ctx.repo->path, value)); |
170 | } else if (!strcmp(name, "include")) |
174 | } else if (!strcmp(name, "include")) |
171 | parse_configfile(value, config_cb); |
175 | parse_configfile(value, config_cb); |
172 | } |
176 | } |
|