From mboxrd@z Thu Jan 1 00:00:00 1970 From: richard.maw at gmail.com (Richard Maw) Date: Fri, 15 Jul 2016 23:59:51 +0100 Subject: [PATCH 05/16] Set GIT_NAMESPACE when repo.namespace is provided In-Reply-To: <20160715230002.29547-1-richard.maw@gmail.com> References: <20160715230002.29547-1-richard.maw@gmail.com> Message-ID: <20160715230002.29547-6-richard.maw@gmail.com> This causes any namespace-aware code to only handle refs under that namespace. Currently this doesn't do much as the only namespace aware code is in recieve-pack and upload-pack, which are not handled by CGit. Signed-off-by: Richard Maw --- cgit.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cgit.c b/cgit.c index 9b2733b..eae2f34 100644 --- a/cgit.c +++ b/cgit.c @@ -566,6 +566,11 @@ static int prepare_repo_cmd(void) /* The path to the git repository. */ setenv("GIT_DIR", ctx.repo->path, 1); + /* Set the namespace in the environment, + * so it gets loaded on the first get_git_namespace() */ + if (ctx.repo->namespace) + setenv("GIT_NAMESPACE", ctx.repo->namespace, 1); + /* Do not look in /etc/ for gitconfig and gitattributes. */ setenv("GIT_CONFIG_NOSYSTEM", "1", 1); setenv("GIT_ATTR_NOSYSTEM", "1", 1); -- 2.9.0