Fix processing of repo.hide and repo.ignore

If the global option enable-filter-overrides is set to 1 the repo-specific
options repo.hide and repo.ignore never got processed.

Signed-off-by: Daniel Reichelt <hacking@nachtgeist.net>
Reviewed-by: John Keeping <john@keeping.me.uk>
Cette révision appartient à :
Daniel Reichelt 2015-08-10 09:45:48 +02:00 révisé par Jason A. Donenfeld
Parent 121e653914
révision dc41a00180

8
cgit.c
Voir le fichier

@ -82,6 +82,10 @@ static void repo_config(struct cgit_repo *repo, const char *name, const char *va
repo->logo = xstrdup(value); repo->logo = xstrdup(value);
else if (!strcmp(name, "logo-link") && value != NULL) else if (!strcmp(name, "logo-link") && value != NULL)
repo->logo_link = xstrdup(value); 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) { else if (ctx.cfg.enable_filter_overrides) {
if (!strcmp(name, "about-filter")) if (!strcmp(name, "about-filter"))
repo->about_filter = cgit_new_filter(value, ABOUT); 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); repo->email_filter = cgit_new_filter(value, EMAIL);
else if (!strcmp(name, "owner-filter")) else if (!strcmp(name, "owner-filter"))
repo->owner_filter = cgit_new_filter(value, OWNER); 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);
} }
} }