diff options
Diffstat (limited to 'cgit.c')
| -rw-r--r-- | cgit.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -9,6 +9,7 @@ #define USE_THE_REPOSITORY_VARIABLE #include "cgit.h" +#include "lang.h" #include "cache.h" #include "cmd.h" #include "configfile.h" @@ -48,6 +49,10 @@ static void repo_config(struct cgit_repo *repo, const char *name, const char *va if (!strcmp(name, "name")) repo->name = xstrdup(value); + else if (!strcmp(name, "primary_lang")) + repo->primary_lang = xstrdup(value); + else if (!strcmp(name, "lang_confidence")) + repo->lang_confidence = atoi(value); else if (!strcmp(name, "clone-url")) repo->clone_url = xstrdup(value); else if (!strcmp(name, "desc")) @@ -613,8 +618,9 @@ static int prepare_repo_cmd(int nongit) } ctx.page.title = fmtalloc("%s - %s", ctx.repo->name, ctx.repo->desc); - if (!ctx.repo->defbranch) + if (!ctx.repo->defbranch) { ctx.repo->defbranch = guess_defbranch(); + } if (!ctx.qry.head) { ctx.qry.nohead = 1; @@ -799,6 +805,8 @@ static void print_repo(FILE *f, struct cgit_repo *repo) { struct string_list_item *item; fprintf(f, "repo.url=%s\n", repo->url); + fprintf(f, "repo.primary_lang=%s\n", repo->primary_lang); + fprintf(f, "repo.lang_confidence=%d\n", repo->lang_confidence); fprintf(f, "repo.name=%s\n", repo->name); fprintf(f, "repo.path=%s\n", repo->path); if (repo->owner) |
