about summary refs log tree commit diff
path: root/cgit.c
diff options
context:
space:
mode:
authorgennyble <gen@nyble.dev>2023-12-16 07:43:48 -0600
committergennyble <gen@nyble.dev>2023-12-16 07:43:48 -0600
commit733a517036bc5ad3327b41f494b0d09cd2470262 (patch)
tree4581a25c2fd60c7e5ef075c6aad788fd1575bfbe /cgit.c
parentfad097a08e55c9eec0fa86efec72de4426674ca2 (diff)
downloadcgit-pink-master.tar.gz
cgit-pink-master.zip
allow ordering sections with scan-path HEAD master
Diffstat (limited to 'cgit.c')
-rw-r--r--cgit.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/cgit.c b/cgit.c
index dd28a79..a501298 100644
--- a/cgit.c
+++ b/cgit.c
@@ -258,7 +258,9 @@ static void config_cb(const char *name, const char *value)
 	else if (!strcmp(name, "repository-sort"))
 		ctx.cfg.repository_sort = xstrdup(value);
 	else if (!strcmp(name, "section-sort"))
-		ctx.cfg.section_sort = atoi(value);
+		ctx.cfg.section_sort = xstrdup(value);
+	else if (!strcmp(name, "section-order"))
+		string_list_append(&ctx.cfg.section_order, xstrdup(value));
 	else if (!strcmp(name, "source-filter"))
 		ctx.cfg.source_filter = cgit_new_filter(value, SOURCE);
 	else if (!strcmp(name, "summary-log"))
@@ -401,7 +403,7 @@ static void prepare_context(void)
 	ctx.cfg.script_name = CGIT_SCRIPT_NAME;
 	ctx.cfg.section = "";
 	ctx.cfg.repository_sort = "name";
-	ctx.cfg.section_sort = 1;
+	ctx.cfg.section_sort = "name";
 	ctx.cfg.summary_branches = 10;
 	ctx.cfg.summary_log = 10;
 	ctx.cfg.summary_tags = 10;