]> granicus.if.org Git - cgit/commitdiff
Parse repo.namespace
authorRichard Maw <richard.maw@gmail.com>
Sat, 25 Jun 2016 19:38:41 +0000 (20:38 +0100)
committerRichard Maw <richard.maw@gmail.com>
Wed, 13 Jul 2016 19:09:37 +0000 (20:09 +0100)
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 <richard.maw@gmail.com>
cgit.c
cgit.h

diff --git a/cgit.c b/cgit.c
index 94d452cbd8f76a8c9358ad5a90a89b4a427eccc7..e525264cf4ea1c0cdba98a57885fc63cb7aba770 100644 (file)
--- 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 49f0557978943c5701e12f913cd266b1981cde8e..93de0ea7bd4c6ed06f3eec089f29739db1cd632b 100644 (file)
--- 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;