]> gitweb.ps.run Git - ps-cgit/blobdiff - cgit.c
Fix processing of repo.hide and repo.ignore
[ps-cgit] / cgit.c
diff --git a/cgit.c b/cgit.c
index 0ad81716f17b3b5bf903e497aaaa4131134ed96a..8c9cfb5e87ad9343f21b6cc0b032575969e4b914 100644 (file)
--- a/cgit.c
+++ b/cgit.c
@@ -82,6 +82,10 @@ static void repo_config(struct cgit_repo *repo, const char *name, const char *va
                repo->logo = xstrdup(value);
        else if (!strcmp(name, "logo-link") && value != NULL)
                repo->logo_link = xstrdup(value);
+       else if (!strcmp(name, "hide"))
+               repo->hide = atoi(value);
+       else if (!strcmp(name, "ignore"))
+               repo->ignore = atoi(value);
        else if (ctx.cfg.enable_filter_overrides) {
                if (!strcmp(name, "about-filter"))
                        repo->about_filter = cgit_new_filter(value, ABOUT);
@@ -93,10 +97,6 @@ static void repo_config(struct cgit_repo *repo, const char *name, const char *va
                        repo->email_filter = cgit_new_filter(value, EMAIL);
                else if (!strcmp(name, "owner-filter"))
                        repo->owner_filter = cgit_new_filter(value, OWNER);
-       } else if (!strcmp(name, "hide")) {
-               repo->hide = atoi(value);
-       } else if (!strcmp(name, "ignore")) {
-               repo->ignore = atoi(value);
        }
 }
 
@@ -599,6 +599,7 @@ static int prepare_repo_cmd(void)
                cgit_print_error("Repository seems to be empty");
                if (!strcmp(ctx.qry.page, "summary")) {
                        html("<table class='list'><tr class='nohover'><td>&nbsp;</td></tr><tr class='nohover'><th class='left'>Clone</th></tr>\n");
+                       cgit_prepare_repo_env(ctx.repo);
                        cgit_add_clone_urls(print_no_repo_clone_urls);
                        html("</table>\n");
                }
@@ -1013,7 +1014,7 @@ static void cgit_parse_args(int argc, const char **argv)
        }
 }
 
-static int calc_ttl()
+static int calc_ttl(void)
 {
        if (!ctx.repo)
                return ctx.cfg.cache_root_ttl;