aboutsummaryrefslogtreecommitdiffstats
path: root/shared.c
diff options
context:
space:
mode:
authorLukas Fleischer <cgit@cryptocrack.de>2015-01-29 12:52:49 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2015-01-29 16:41:14 +0100
commitc58cec9dff273b44c428cfaee24e5e3743c0034e (patch)
tree7302ee9868fa94b9cf64a2a361294ad2e4bc360f /shared.c
parent1a2eeb94d42b983213076906eb5c5b85452b2c30 (diff)
downloadcgit-c58cec9dff273b44c428cfaee24e5e3743c0034e.tar.gz
cgit-c58cec9dff273b44c428cfaee24e5e3743c0034e.tar.bz2
cgit-c58cec9dff273b44c428cfaee24e5e3743c0034e.zip
Add repo.hide and repo.ignore
These options can be used to hide a repository from the index or completely ignore a repository, respectively. They are particularly useful when used in combination with scan-path. Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
Diffstat (limited to 'shared.c')
-rw-r--r--shared.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/shared.c b/shared.c
index 6e91857..ae17d78 100644
--- a/shared.c
+++ b/shared.c
@@ -75,6 +75,7 @@ struct cgit_repo *cgit_add_repo(const char *url)
ret->owner_filter = ctx.cfg.owner_filter;
ret->clone_url = ctx.cfg.clone_url;
ret->submodules.strdup_strings = 1;
+ ret->hide = ret->ignore = 0;
return ret;
}
@@ -85,6 +86,8 @@ struct cgit_repo *cgit_get_repoinfo(const char *url)
for (i = 0; i < cgit_repolist.count; i++) {
repo = &cgit_repolist.repos[i];
+ if (repo->ignore)
+ continue;
if (!strcmp(repo->url, url))
return repo;
}