diff options
Diffstat (limited to 'cgit.c')
| -rw-r--r-- | cgit.c | 12 |
1 files changed, 10 insertions, 2 deletions
| @@ -70,9 +70,9 @@ void repo_config(struct cgit_repo *repo, const char *name, const char *value) | |||
| 70 | repo->section = xstrdup(value); | 70 | repo->section = xstrdup(value); |
| 71 | else if (!strcmp(name, "readme") && value != NULL) { | 71 | else if (!strcmp(name, "readme") && value != NULL) { |
| 72 | if (*value == '/') | 72 | if (*value == '/') |
| 73 | ctx.repo->readme = xstrdup(value); | 73 | repo->readme = xstrdup(value); |
| 74 | else | 74 | else |
| 75 | ctx.repo->readme = xstrdup(fmt("%s/%s", ctx.repo->path, value)); | 75 | repo->readme = xstrdup(fmt("%s/%s", repo->path, value)); |
| 76 | } else if (ctx.cfg.enable_filter_overrides) { | 76 | } else if (ctx.cfg.enable_filter_overrides) { |
| 77 | if (!strcmp(name, "about-filter")) | 77 | if (!strcmp(name, "about-filter")) |
| 78 | repo->about_filter = new_filter(value, 0); | 78 | repo->about_filter = new_filter(value, 0); |
| @@ -169,6 +169,8 @@ void config_cb(const char *name, const char *value) | |||
| 169 | ctx.cfg.max_msg_len = atoi(value); | 169 | ctx.cfg.max_msg_len = atoi(value); |
| 170 | else if (!strcmp(name, "max-repodesc-length")) | 170 | else if (!strcmp(name, "max-repodesc-length")) |
| 171 | ctx.cfg.max_repodesc_len = atoi(value); | 171 | ctx.cfg.max_repodesc_len = atoi(value); |
| 172 | else if (!strcmp(name, "max-blob-size")) | ||
| 173 | ctx.cfg.max_blob_size = atoi(value); | ||
| 172 | else if (!strcmp(name, "max-repo-count")) | 174 | else if (!strcmp(name, "max-repo-count")) |
| 173 | ctx.cfg.max_repo_count = atoi(value); | 175 | ctx.cfg.max_repo_count = atoi(value); |
| 174 | else if (!strcmp(name, "max-commit-count")) | 176 | else if (!strcmp(name, "max-commit-count")) |
| @@ -186,6 +188,8 @@ void config_cb(const char *name, const char *value) | |||
| 186 | ctx.cfg.summary_branches = atoi(value); | 188 | ctx.cfg.summary_branches = atoi(value); |
| 187 | else if (!strcmp(name, "summary-tags")) | 189 | else if (!strcmp(name, "summary-tags")) |
| 188 | ctx.cfg.summary_tags = atoi(value); | 190 | ctx.cfg.summary_tags = atoi(value); |
| 191 | else if (!strcmp(name, "side-by-side-diffs")) | ||
| 192 | ctx.cfg.ssdiff = atoi(value); | ||
| 189 | else if (!strcmp(name, "agefile")) | 193 | else if (!strcmp(name, "agefile")) |
| 190 | ctx.cfg.agefile = xstrdup(value); | 194 | ctx.cfg.agefile = xstrdup(value); |
| 191 | else if (!strcmp(name, "renamelimit")) | 195 | else if (!strcmp(name, "renamelimit")) |
| @@ -244,6 +248,8 @@ static void querystring_cb(const char *name, const char *value) | |||
| 244 | ctx.qry.showmsg = atoi(value); | 248 | ctx.qry.showmsg = atoi(value); |
| 245 | } else if (!strcmp(name, "period")) { | 249 | } else if (!strcmp(name, "period")) { |
| 246 | ctx.qry.period = xstrdup(value); | 250 | ctx.qry.period = xstrdup(value); |
| 251 | } else if (!strcmp(name, "ss")) { | ||
| 252 | ctx.qry.ssdiff = atoi(value); | ||
| 247 | } | 253 | } |
| 248 | } | 254 | } |
| 249 | 255 | ||
| @@ -274,6 +280,7 @@ static void prepare_context(struct cgit_context *ctx) | |||
| 274 | ctx->cfg.max_lock_attempts = 5; | 280 | ctx->cfg.max_lock_attempts = 5; |
| 275 | ctx->cfg.max_msg_len = 80; | 281 | ctx->cfg.max_msg_len = 80; |
| 276 | ctx->cfg.max_repodesc_len = 80; | 282 | ctx->cfg.max_repodesc_len = 80; |
| 283 | ctx->cfg.max_blob_size = 0; | ||
| 277 | ctx->cfg.max_stats = 0; | 284 | ctx->cfg.max_stats = 0; |
| 278 | ctx->cfg.module_link = "./?repo=%s&page=commit&id=%s"; | 285 | ctx->cfg.module_link = "./?repo=%s&page=commit&id=%s"; |
| 279 | ctx->cfg.renamelimit = -1; | 286 | ctx->cfg.renamelimit = -1; |
| @@ -285,6 +292,7 @@ static void prepare_context(struct cgit_context *ctx) | |||
| 285 | ctx->cfg.summary_branches = 10; | 292 | ctx->cfg.summary_branches = 10; |
| 286 | ctx->cfg.summary_log = 10; | 293 | ctx->cfg.summary_log = 10; |
| 287 | ctx->cfg.summary_tags = 10; | 294 | ctx->cfg.summary_tags = 10; |
| 295 | ctx->cfg.ssdiff = 0; | ||
| 288 | ctx->env.cgit_config = xstrdupn(getenv("CGIT_CONFIG")); | 296 | ctx->env.cgit_config = xstrdupn(getenv("CGIT_CONFIG")); |
| 289 | ctx->env.http_host = xstrdupn(getenv("HTTP_HOST")); | 297 | ctx->env.http_host = xstrdupn(getenv("HTTP_HOST")); |
| 290 | ctx->env.https = xstrdupn(getenv("HTTPS")); | 298 | ctx->env.https = xstrdupn(getenv("HTTPS")); |
