cgit_open_filter: also take the repo as a parameter To prepare for handing repo configuration to the filter script that is executed. Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl> Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Ferry Huberts ferry.huberts@pelagic.nl
Wed, 23 Mar 2011 11:57:42 +0100
7 files changed,
9 insertions(+),
9 deletions(-)
M
cgit.h
→
cgit.h
@@ -318,7 +318,7 @@ extern const char *cgit_repobasename(const char *reponame);
extern int cgit_parse_snapshots_mask(const char *str); -extern int cgit_open_filter(struct cgit_filter *filter); +extern int cgit_open_filter(struct cgit_filter *filter, struct cgit_repo * repo); extern int cgit_close_filter(struct cgit_filter *filter); extern int readfile(const char *path, char **buf, size_t *size);
M
ui-commit.c
→
ui-commit.c
@@ -110,7 +110,7 @@ }
html("</table>\n"); html("<div class='commit-subject'>"); if (ctx.repo->commit_filter) - cgit_open_filter(ctx.repo->commit_filter); + cgit_open_filter(ctx.repo->commit_filter, ctx.repo); html_txt(info->subject); if (ctx.repo->commit_filter) cgit_close_filter(ctx.repo->commit_filter);@@ -118,7 +118,7 @@ show_commit_decorations(commit);
html("</div>"); html("<div class='commit-msg'>"); if (ctx.repo->commit_filter) - cgit_open_filter(ctx.repo->commit_filter); + cgit_open_filter(ctx.repo->commit_filter, ctx.repo); html_txt(info->msg); if (ctx.repo->commit_filter) cgit_close_filter(ctx.repo->commit_filter);@@ -127,7 +127,7 @@ if (notes.len != 0) {
html("<div class='notes-header'>Notes</div>"); html("<div class='notes'>"); if (ctx.repo->commit_filter) - cgit_open_filter(ctx.repo->commit_filter); + cgit_open_filter(ctx.repo->commit_filter, ctx.repo); html_txt(notes.buf); if (ctx.repo->commit_filter) cgit_close_filter(ctx.repo->commit_filter);
M
ui-repolist.c
→
ui-repolist.c
@@ -291,7 +291,7 @@ {
if (!ctx.cfg.root_readme) return; if (ctx.cfg.about_filter) - cgit_open_filter(ctx.cfg.about_filter); + cgit_open_filter(ctx.cfg.about_filter, NULL); html_include(ctx.cfg.root_readme); if (ctx.cfg.about_filter) cgit_close_filter(ctx.cfg.about_filter);
M
ui-snapshot.c
→
ui-snapshot.c
@@ -19,7 +19,7 @@ f.cmd = xstrdup(filter);
f.argv = malloc(2 * sizeof(char *)); f.argv[0] = f.cmd; f.argv[1] = NULL; - cgit_open_filter(&f); + cgit_open_filter(&f, NULL); rv = write_tar_archive(args); cgit_close_filter(&f); return rv;
M
ui-summary.c
→
ui-summary.c
@@ -113,7 +113,7 @@ * filesystem, while applying the about-filter.
*/ html("<div id='summary'>"); if (ctx.repo->about_filter) - cgit_open_filter(ctx.repo->about_filter); + cgit_open_filter(ctx.repo->about_filter, ctx.repo); if (ref) cgit_print_file(tmp, ref); else
M
ui-tree.c
→
ui-tree.c
@@ -45,7 +45,7 @@
if (ctx.repo->source_filter) { html("<td class='lines'><pre><code>"); ctx.repo->source_filter->argv[1] = xstrdup(name); - cgit_open_filter(ctx.repo->source_filter); + cgit_open_filter(ctx.repo->source_filter, ctx.repo); html_raw(buf, size); cgit_close_filter(ctx.repo->source_filter); html("</code></pre></td></tr></table>\n");