about summary refs log tree commit diff stats
path: root/cgit.c
diff options
context:
space:
mode:
Diffstat (limited to 'cgit.c')
-rw-r--r--cgit.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/cgit.c b/cgit.c index 624cb2c..6a75f27 100644 --- a/cgit.c +++ b/cgit.c
@@ -60,6 +60,8 @@ static void process_cached_repolist(const char *path);
60 60
61void repo_config(struct cgit_repo *repo, const char *name, const char *value) 61void repo_config(struct cgit_repo *repo, const char *name, const char *value)
62{ 62{
63 struct string_list_item *item;
64
63 if (!strcmp(name, "name")) 65 if (!strcmp(name, "name"))
64 repo->name = xstrdup(value); 66 repo->name = xstrdup(value);
65 else if (!strcmp(name, "clone-url")) 67 else if (!strcmp(name, "clone-url"))
@@ -86,7 +88,10 @@ void repo_config(struct cgit_repo *repo, const char *name, const char *value)
86 repo->max_stats = cgit_find_stats_period(value, NULL); 88 repo->max_stats = cgit_find_stats_period(value, NULL);
87 else if (!strcmp(name, "module-link")) 89 else if (!strcmp(name, "module-link"))
88 repo->module_link= xstrdup(value); 90 repo->module_link= xstrdup(value);
89 else if (!strcmp(name, "section")) 91 else if (!prefixcmp(name, "module-link.")) {
92 item = string_list_append(&repo->submodules, name + 12);
93 item->util = xstrdup(value);
94 } else if (!strcmp(name, "section"))
90 repo->section = xstrdup(value); 95 repo->section = xstrdup(value);
91 else if (!strcmp(name, "readme") && value != NULL) 96 else if (!strcmp(name, "readme") && value != NULL)
92 repo->readme = xstrdup(value); 97 repo->readme = xstrdup(value);
@@ -298,6 +303,7 @@ static void querystring_cb(const char *name, const char *value)
298 ctx.qry.period = xstrdup(value); 303 ctx.qry.period = xstrdup(value);
299 } else if (!strcmp(name, "ss")) { 304 } else if (!strcmp(name, "ss")) {
300 ctx.qry.ssdiff = atoi(value); 305 ctx.qry.ssdiff = atoi(value);
306 ctx.qry.has_ssdiff = 1;
301 } else if (!strcmp(name, "all")) { 307 } else if (!strcmp(name, "all")) {
302 ctx.qry.show_all = atoi(value); 308 ctx.qry.show_all = atoi(value);
303 } else if (!strcmp(name, "context")) { 309 } else if (!strcmp(name, "context")) {
@@ -338,7 +344,6 @@ static void prepare_context(struct cgit_context *ctx)
338 ctx->cfg.max_repodesc_len = 80; 344 ctx->cfg.max_repodesc_len = 80;
339 ctx->cfg.max_blob_size = 0; 345 ctx->cfg.max_blob_size = 0;
340 ctx->cfg.max_stats = 0; 346 ctx->cfg.max_stats = 0;
341 ctx->cfg.module_link = "./?repo=%s&page=commit&id=%s";
342 ctx->cfg.project_list = NULL; 347 ctx->cfg.project_list = NULL;
343 ctx->cfg.renamelimit = -1; 348 ctx->cfg.renamelimit = -1;
344 ctx->cfg.remove_suffix = 0; 349 ctx->cfg.remove_suffix = 0;
@@ -482,6 +487,7 @@ static int prepare_repo_cmd(struct cgit_context *ctx)
482 cgit_print_docend(); 487 cgit_print_docend();
483 return 1; 488 return 1;
484 } 489 }
490 sort_string_list(&ctx->repo->submodules);
485 cgit_prepare_repo_env(ctx->repo); 491 cgit_prepare_repo_env(ctx->repo);
486 return 0; 492 return 0;
487} 493}