diff options
author | Lukas Fleischer | 2015-01-29 12:52:49 +0100 |
---|---|---|
committer | Jason A. Donenfeld | 2015-01-29 16:41:14 +0100 |
commit | c58cec9dff273b44c428cfaee24e5e3743c0034e (patch) | |
tree | 7302ee9868fa94b9cf64a2a361294ad2e4bc360f /shared.c | |
parent | Add Etags for snapshots (diff) | |
download | cgit-c58cec9dff273b44c428cfaee24e5e3743c0034e.tar.gz 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.c | 3 |
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) | |||
75 | ret->owner_filter = ctx.cfg.owner_filter; | 75 | ret->owner_filter = ctx.cfg.owner_filter; |
76 | ret->clone_url = ctx.cfg.clone_url; | 76 | ret->clone_url = ctx.cfg.clone_url; |
77 | ret->submodules.strdup_strings = 1; | 77 | ret->submodules.strdup_strings = 1; |
78 | ret->hide = ret->ignore = 0; | ||
78 | return ret; | 79 | return ret; |
79 | } | 80 | } |
80 | 81 | ||
@@ -85,6 +86,8 @@ struct cgit_repo *cgit_get_repoinfo(const char *url) | |||
85 | 86 | ||
86 | for (i = 0; i < cgit_repolist.count; i++) { | 87 | for (i = 0; i < cgit_repolist.count; i++) { |
87 | repo = &cgit_repolist.repos[i]; | 88 | repo = &cgit_repolist.repos[i]; |
89 | if (repo->ignore) | ||
90 | continue; | ||
88 | if (!strcmp(repo->url, url)) | 91 | if (!strcmp(repo->url, url)) |
89 | return repo; | 92 | return repo; |
90 | } | 93 | } |