aboutsummaryrefslogtreecommitdiff
path: root/ui-ci.c
diff refs
from: back
to: back
| flip
diff options
context:
space:
mode:
Diffstat (limited to 'ui-ci.c')
-rw-r--r--ui-ci.c31
1 files changed, 4 insertions, 27 deletions
diff --git a/ui-ci.c b/ui-ci.c
index f2561a2..1c9f39c 100644
--- a/ui-ci.c
+++ b/ui-ci.c
@@ -1,6 +1,6 @@
/* ui-ci.c: redirect to an external CI system
*
- * Copyright (C) 2026 Saya Andy <saya.andy@posteo.com>
+ * Copyright (C) 2006-2025 cgit Development Team <cgit@lists.zx2c4.com>
*
* Licensed under GNU General Public License v2
* (see COPYING for full license text)
@@ -73,24 +73,9 @@ static char *expand_ci_url(const char *template)
return strbuf_detach(&buf, NULL);
}
-/* Ask the ci filter whether the pipeline denoted by url actually exists.
- * The filter must not write to stdout, and signals "yes" by exiting with
- * a zero status.
- */
-static int ci_filter_accepts(const char *refkind, const char *url)
-{
- struct cgit_filter *filter = ctx.repo->ci_filter;
-
- if (!filter)
- return 1;
- if (cgit_open_filter(filter, ctx.qry.head, refkind, url))
- return 0;
- return !cgit_close_filter(filter);
-}
-
static void resolve_ci_url(void)
{
- const char *template, *refkind;
+ const char *template;
if (ci_resolved != -1)
return;
@@ -99,24 +84,16 @@ static void resolve_ci_url(void)
if (!ctx.repo || !ctx.qry.head || !cgit_have_repository())
return;
- if (ref_is_tag(ctx.qry.head)) {
- refkind = "tag";
+ if (ref_is_tag(ctx.qry.head))
template = ctx.repo->ci_tag_url;
- } else {
- refkind = "branch";
+ else
template = ctx.repo->ci_branch_url;
- }
if (!template)
template = ctx.repo->ci_url;
if (!template)
return;
ci_url = expand_ci_url(template);
- if (!ci_filter_accepts(refkind, ci_url)) {
- free(ci_url);
- ci_url = NULL;
- return;
- }
ci_resolved = 1;
}