diff options
| author | Elis Eriksson <spelis.tech@gmail.com> | 2026-03-26 19:08:03 +0100 |
|---|---|---|
| committer | Elis Eriksson <spelis.tech@gmail.com> | 2026-03-26 19:08:03 +0100 |
| commit | a2a39cb2287a29767fa3bc98d05f01430c668362 (patch) | |
| tree | 5428225706ae55714227f330e4f8503a96d9cee2 /cgit.c | |
| parent | 0d8e5fbc31e1082063bfb5155c35b7869721152b (diff) | |
| download | cgit-a2a39cb2287a29767fa3bc98d05f01430c668362.tar cgit-a2a39cb2287a29767fa3bc98d05f01430c668362.tar.gz cgit-a2a39cb2287a29767fa3bc98d05f01430c668362.tar.bz2 cgit-a2a39cb2287a29767fa3bc98d05f01430c668362.tar.lz cgit-a2a39cb2287a29767fa3bc98d05f01430c668362.tar.xz cgit-a2a39cb2287a29767fa3bc98d05f01430c668362.tar.zst cgit-a2a39cb2287a29767fa3bc98d05f01430c668362.zip | |
slight changes, idk how to write proper commit messages hehe
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) |
