aboutsummaryrefslogtreecommitdiffstats
path: root/cgit.c
diff options
context:
space:
mode:
authorLars Hjemli2012-03-18 20:59:36 +0000
committerLars Hjemli2012-03-18 20:59:36 +0000
commit2b9fab8d30420d935745c4d84ea22412ab2485e5 (patch)
tree664ebc3d061fd7e89393af67bfbc406f3b600be0 /cgit.c
parent08352c7a02f057f6cbaf817ca7e53c53be590a62 (diff)
parent3fbaf097153b239b092d11a178ace96671f9f3ec (diff)
downloadcgit-2b9fab8d30420d935745c4d84ea22412ab2485e5.tar.gz
cgit-2b9fab8d30420d935745c4d84ea22412ab2485e5.tar.bz2
cgit-2b9fab8d30420d935745c4d84ea22412ab2485e5.zip
Merge branch 'lh/module-links'
Diffstat (limited to 'cgit.c')
-rw-r--r--cgit.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/cgit.c b/cgit.c
index 1d50129..7e3d349 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);
@@ -339,7 +344,6 @@ static void prepare_context(struct cgit_context *ctx)
339 ctx->cfg.max_repodesc_len = 80; 344 ctx->cfg.max_repodesc_len = 80;
340 ctx->cfg.max_blob_size = 0; 345 ctx->cfg.max_blob_size = 0;
341 ctx->cfg.max_stats = 0; 346 ctx->cfg.max_stats = 0;
342 ctx->cfg.module_link = "./?repo=%s&page=commit&id=%s";
343 ctx->cfg.project_list = NULL; 347 ctx->cfg.project_list = NULL;
344 ctx->cfg.renamelimit = -1; 348 ctx->cfg.renamelimit = -1;
345 ctx->cfg.remove_suffix = 0; 349 ctx->cfg.remove_suffix = 0;
@@ -470,6 +474,7 @@ static int prepare_repo_cmd(struct cgit_context *ctx)
470 cgit_print_docend(); 474 cgit_print_docend();
471 return 1; 475 return 1;
472 } 476 }
477 sort_string_list(&ctx->repo->submodules);
473 cgit_prepare_repo_env(ctx->repo); 478 cgit_prepare_repo_env(ctx->repo);
474 return 0; 479 return 0;
475} 480}