aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@gmail.com>2016-06-25 20:51:36 +0100
committerRichard Maw <richard.maw@gmail.com>2016-07-13 20:09:37 +0100
commita76460c5ed75ca950c18373990a2135c895daad4 (patch)
treecfcffa9f36a4f2f11069e5191d9ad978480087dc
parent21637776234574c4bbedf45af7f59663b46458bd (diff)
downloadcgit-a76460c5ed75ca950c18373990a2135c895daad4.tar.gz
cgit-a76460c5ed75ca950c18373990a2135c895daad4.tar.bz2
cgit-a76460c5ed75ca950c18373990a2135c895daad4.zip
Set GIT_NAMESPACE when repo.namespace is provided
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 <richard.maw@gmail.com>
-rw-r--r--cgit.c5
1 files changed, 5 insertions, 0 deletions
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);