From 5784efc9de06731cda916dd4575b43b93871dda3 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Thu, 9 Jun 2022 17:40:38 -0500 Subject: Apply default-tab patch --- cgit.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'cgit.c') diff --git a/cgit.c b/cgit.c index dd28a79..0c5ccab 100644 --- a/cgit.c +++ b/cgit.c @@ -56,6 +56,8 @@ static void repo_config(struct cgit_repo *repo, const char *name, const char *va repo->homepage = xstrdup(value); else if (!strcmp(name, "defbranch")) repo->defbranch = xstrdup(value); + else if (!strcmp(name, "default-tab")) + repo->default_tab = xstrdup(value); else if (!strcmp(name, "extra-head-content")) repo->extra_head_content = xstrdup(value); else if (!strcmp(name, "snapshots")) @@ -285,6 +287,10 @@ static void config_cb(const char *name, const char *value) ctx.cfg.clone_url = xstrdup(value); else if (!strcmp(name, "local-time")) ctx.cfg.local_time = atoi(value); + else if (!strcmp(name, "default-tab")) + ctx.cfg.default_tab = xstrdup(value); + else if (!strcmp(name, "root-default-tab")) + ctx.cfg.root_default_tab = xstrdup(value); else if (!strcmp(name, "commit-sort")) { if (!strcmp(value, "date")) ctx.cfg.commit_sort = 1; @@ -373,6 +379,8 @@ static void prepare_context(void) ctx.cfg.cache_scanrc_ttl = 15; ctx.cfg.cache_dynamic_ttl = 5; ctx.cfg.cache_static_ttl = -1; + ctx.cfg.default_tab = "summary"; + ctx.cfg.root_default_tab = "repolist"; ctx.cfg.case_sensitive_sort = 1; ctx.cfg.branch_sort = 0; ctx.cfg.commit_sort = 0; @@ -818,6 +826,8 @@ static void print_repo(FILE *f, struct cgit_repo *repo) fprintf(f, "repo.homepage=%s\n", repo->homepage); if (repo->clone_url) fprintf(f, "repo.clone-url=%s\n", repo->clone_url); + if (repo->default_tab) + fprintf(f, "repo.default-tab=%s\n", repo->default_tab); fprintf(f, "repo.enable-blame=%d\n", repo->enable_blame); fprintf(f, "repo.enable-commit-graph=%d\n", -- cgit 1.4.1-21-gabe81