|
diff --git a/cgit.c b/cgit.c index 2cda554..fd341b8 100644 --- a/ cgit.c+++ b/ cgit.c |
|
@@ -133,32 +133,36 @@ void config_cb(const char *name, const char *value) |
133 | else if (ctx.repo && !strcmp(name, "repo.desc")) |
133 | else if (ctx.repo && !strcmp(name, "repo.desc")) |
134 | ctx.repo->desc = xstrdup(value); |
134 | ctx.repo->desc = xstrdup(value); |
135 | else if (ctx.repo && !strcmp(name, "repo.owner")) |
135 | else if (ctx.repo && !strcmp(name, "repo.owner")) |
136 | ctx.repo->owner = xstrdup(value); |
136 | ctx.repo->owner = xstrdup(value); |
137 | else if (ctx.repo && !strcmp(name, "repo.defbranch")) |
137 | else if (ctx.repo && !strcmp(name, "repo.defbranch")) |
138 | ctx.repo->defbranch = xstrdup(value); |
138 | ctx.repo->defbranch = xstrdup(value); |
139 | else if (ctx.repo && !strcmp(name, "repo.snapshots")) |
139 | else if (ctx.repo && !strcmp(name, "repo.snapshots")) |
140 | ctx.repo->snapshots = ctx.cfg.snapshots & cgit_parse_snapshots_mask(value); /* XXX: &? */ |
140 | ctx.repo->snapshots = ctx.cfg.snapshots & cgit_parse_snapshots_mask(value); /* XXX: &? */ |
141 | else if (ctx.repo && !strcmp(name, "repo.enable-log-filecount")) |
141 | else if (ctx.repo && !strcmp(name, "repo.enable-log-filecount")) |
142 | ctx.repo->enable_log_filecount = ctx.cfg.enable_log_filecount * atoi(value); |
142 | ctx.repo->enable_log_filecount = ctx.cfg.enable_log_filecount * atoi(value); |
143 | else if (ctx.repo && !strcmp(name, "repo.enable-log-linecount")) |
143 | else if (ctx.repo && !strcmp(name, "repo.enable-log-linecount")) |
144 | ctx.repo->enable_log_linecount = ctx.cfg.enable_log_linecount * atoi(value); |
144 | ctx.repo->enable_log_linecount = ctx.cfg.enable_log_linecount * atoi(value); |
145 | else if (ctx.repo && !strcmp(name, "repo.max-stats")) |
145 | else if (ctx.repo && !strcmp(name, "repo.max-stats")) |
146 | ctx.repo->max_stats = cgit_find_stats_period(value, NULL); |
146 | ctx.repo->max_stats = cgit_find_stats_period(value, NULL); |
147 | else if (ctx.repo && !strcmp(name, "repo.module-link")) |
147 | else if (ctx.repo && !strcmp(name, "repo.module-link")) |
148 | ctx.repo->module_link= xstrdup(value); |
148 | ctx.repo->module_link= xstrdup(value); |
| |
149 | else if (ctx.repo && !strcmp(name, "repo.commit-filter")) |
| |
150 | ctx.repo->commit_filter = new_filter(value, 0); |
| |
151 | else if (ctx.repo && !strcmp(name, "repo.source-filter")) |
| |
152 | ctx.repo->source_filter = new_filter(value, 1); |
149 | else if (ctx.repo && !strcmp(name, "repo.readme") && value != NULL) { |
153 | else if (ctx.repo && !strcmp(name, "repo.readme") && value != NULL) { |
150 | if (*value == '/') |
154 | if (*value == '/') |
151 | ctx.repo->readme = xstrdup(value); |
155 | ctx.repo->readme = xstrdup(value); |
152 | else |
156 | else |
153 | ctx.repo->readme = xstrdup(fmt("%s/%s", ctx.repo->path, value)); |
157 | ctx.repo->readme = xstrdup(fmt("%s/%s", ctx.repo->path, value)); |
154 | } else if (!strcmp(name, "include")) |
158 | } else if (!strcmp(name, "include")) |
155 | parse_configfile(value, config_cb); |
159 | parse_configfile(value, config_cb); |
156 | } |
160 | } |
157 | |
161 | |
158 | static void querystring_cb(const char *name, const char *value) |
162 | static void querystring_cb(const char *name, const char *value) |
159 | { |
163 | { |
160 | if (!strcmp(name,"r")) { |
164 | if (!strcmp(name,"r")) { |
161 | ctx.qry.repo = xstrdup(value); |
165 | ctx.qry.repo = xstrdup(value); |
162 | ctx.repo = cgit_get_repoinfo(value); |
166 | ctx.repo = cgit_get_repoinfo(value); |
163 | } else if (!strcmp(name, "p")) { |
167 | } else if (!strcmp(name, "p")) { |
164 | ctx.qry.page = xstrdup(value); |
168 | ctx.qry.page = xstrdup(value); |
|