aboutsummaryrefslogtreecommitdiff
path: root/cgit.c
diff options
from:
to:
context:
space:
mode:
Diffstat (limited to 'cgit.c')
-rw-r--r--cgit.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/cgit.c b/cgit.c
index 5bf52f8..c21117e 100644
--- a/cgit.c
+++ b/cgit.c
@@ -56,6 +56,16 @@ void cgit_repo_config(struct cgit_repo *repo, const char *name, const char *valu
repo->owner = strdup_first_line(value);
else if (!strcmp(name, "homepage"))
repo->homepage = strdup_first_line(value);
+ else if (!strcmp(name, "ci-url")) {
+ repo->ci_url = strdup_first_line(value);
+ if (repo->ci_branch_url == ctx.cfg.ci_branch_url)
+ repo->ci_branch_url = NULL;
+ if (repo->ci_tag_url == ctx.cfg.ci_tag_url)
+ repo->ci_tag_url = NULL;
+ } else if (!strcmp(name, "ci-branch-url"))
+ repo->ci_branch_url = strdup_first_line(value);
+ else if (!strcmp(name, "ci-tag-url"))
+ repo->ci_tag_url = strdup_first_line(value);
else if (!strcmp(name, "defbranch"))
repo->defbranch = strdup_first_line(value);
else if (!strcmp(name, "extra-head-content"))
@@ -163,6 +173,12 @@ static void config_cb(const char *name, const char *value)
ctx.cfg.logo_link = strdup_first_line(value);
else if (!strcmp(name, "module-link"))
ctx.cfg.module_link = strdup_first_line(value);
+ else if (!strcmp(name, "ci-url"))
+ ctx.cfg.ci_url = strdup_first_line(value);
+ else if (!strcmp(name, "ci-branch-url"))
+ ctx.cfg.ci_branch_url = strdup_first_line(value);
+ else if (!strcmp(name, "ci-tag-url"))
+ ctx.cfg.ci_tag_url = strdup_first_line(value);
else if (!strcmp(name, "strict-export"))
ctx.cfg.strict_export = strdup_first_line(value);
else if (!strcmp(name, "virtual-root"))
@@ -815,6 +831,12 @@ static void print_repo(FILE *f, struct cgit_repo *repo)
fprintf(f, "repo.section=%s\n", repo->section);
if (repo->homepage)
fprintf(f, "repo.homepage=%s\n", repo->homepage);
+ if (repo->ci_url)
+ fprintf(f, "repo.ci-url=%s\n", repo->ci_url);
+ if (repo->ci_branch_url)
+ fprintf(f, "repo.ci-branch-url=%s\n", repo->ci_branch_url);
+ if (repo->ci_tag_url)
+ fprintf(f, "repo.ci-tag-url=%s\n", repo->ci_tag_url);
if (repo->clone_url)
fprintf(f, "repo.clone-url=%s\n", repo->clone_url);
fprintf(f, "repo.enable-blame=%d\n",