From mboxrd@z Thu Jan 1 00:00:00 1970 From: richard.maw at gmail.com (Richard Maw) Date: Mon, 1 Aug 2016 22:35:36 +0100 Subject: [PATCH v3 04/21] Parse repo.namespace In-Reply-To: <20160801213553.16807-1-richard.maw@gmail.com> References: <20160801213553.16807-1-richard.maw@gmail.com> Message-ID: <20160801213553.16807-5-richard.maw@gmail.com> This contains the unexpanded name of the namespace rather than the base ref of the namespace, since the git namespace mechanism works by setting GIT_NAMESPACE and on the first call to get_git_namespace() it gets expanded. We need to save this for a later call to prepare_repo_cmd, rather than trying to process it here, since we can only do it once, and we have other uses for the unexpanded name. Signed-off-by: Richard Maw --- cgit.c | 2 ++ cgit.h | 1 + 2 files changed, 3 insertions(+) diff --git a/cgit.c b/cgit.c index 3763a30..304027c 100644 --- a/cgit.c +++ b/cgit.c @@ -45,6 +45,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, "namespace")) + repo->namespace = xstrdup(value); else if (!strcmp(name, "snapshots")) repo->snapshots = ctx.cfg.snapshots & cgit_parse_snapshots_mask(value); else if (!strcmp(name, "enable-commit-graph")) diff --git a/cgit.h b/cgit.h index 49f0557..93de0ea 100644 --- a/cgit.h +++ b/cgit.h @@ -87,6 +87,7 @@ struct cgit_repo { struct string_list readme; char *section; char *clone_url; + char *namespace; char *logo; char *logo_link; int snapshots; -- 2.9.0