From a2a39cb2287a29767fa3bc98d05f01430c668362 Mon Sep 17 00:00:00 2001 From: Elis Eriksson Date: Thu, 26 Mar 2026 19:08:03 +0100 Subject: slight changes, idk how to write proper commit messages hehe --- cgit.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'cgit.c') diff --git a/cgit.c b/cgit.c index c4dc94c..430c79b 100644 --- a/cgit.c +++ b/cgit.c @@ -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) -- cgit v1.3-7-ge9ab