author | Lars Hjemli <hjemli@gmail.com> | 2009-08-09 11:22:00 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2009-08-09 11:22:00 (UTC) |
commit | e976df27952ca1e450c1c3d420532ac9f5e3036b (patch) (side-by-side diff) | |
tree | 2634538f3144c935d1579315d4de289e6c890f19 /shared.c | |
parent | f35db1cd2b75aac6952aa07713e44ca01fd89727 (diff) | |
download | cgit-e976df27952ca1e450c1c3d420532ac9f5e3036b.zip cgit-e976df27952ca1e450c1c3d420532ac9f5e3036b.tar.gz cgit-e976df27952ca1e450c1c3d420532ac9f5e3036b.tar.bz2 |
Add support for repo.commit-filter and repo.source-filter
These options can be used to override the default commit- and source-
filter settings per repository.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
-rw-r--r-- | shared.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -33,64 +33,66 @@ int chk_non_negative(int result, char *msg) return result; } struct cgit_repo *cgit_add_repo(const char *url) { struct cgit_repo *ret; if (++cgit_repolist.count > cgit_repolist.length) { if (cgit_repolist.length == 0) cgit_repolist.length = 8; else cgit_repolist.length *= 2; cgit_repolist.repos = xrealloc(cgit_repolist.repos, cgit_repolist.length * sizeof(struct cgit_repo)); } ret = &cgit_repolist.repos[cgit_repolist.count-1]; ret->url = trim_end(url, '/'); ret->name = ret->url; ret->path = NULL; ret->desc = "[no description]"; ret->owner = NULL; ret->group = ctx.cfg.repo_group; ret->defbranch = "master"; ret->snapshots = ctx.cfg.snapshots; ret->enable_log_filecount = ctx.cfg.enable_log_filecount; ret->enable_log_linecount = ctx.cfg.enable_log_linecount; ret->max_stats = ctx.cfg.max_stats; ret->module_link = ctx.cfg.module_link; ret->readme = NULL; ret->mtime = -1; + ret->commit_filter = ctx.cfg.commit_filter; + ret->source_filter = ctx.cfg.source_filter; return ret; } struct cgit_repo *cgit_get_repoinfo(const char *url) { int i; struct cgit_repo *repo; for (i=0; i<cgit_repolist.count; i++) { repo = &cgit_repolist.repos[i]; if (!strcmp(repo->url, url)) return repo; } return NULL; } void *cgit_free_commitinfo(struct commitinfo *info) { free(info->author); free(info->author_email); free(info->committer); free(info->committer_email); free(info->subject); free(info->msg); free(info->msg_encoding); free(info); return NULL; } char *trim_end(const char *str, char c) { int len; |