X-Git-Url: https://gitweb.ps.run/ps-cgit/blobdiff_plain/db021a1989a52911557ce6b998c11fbe4a4bea9d..d7034806a4b1279f62d606501f831dcad31798e6:/ui-shared.c
diff --git a/ui-shared.c b/ui-shared.c
index 1dd8722..4f84b7c 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -689,6 +689,14 @@ void cgit_print_http_headers(void)
exit(0);
}
+void cgit_redirect(const char *url, bool permanent)
+{
+ htmlf("Status: %d %s\n", permanent ? 301 : 302, permanent ? "Moved" : "Found");
+ htmlf("Location: %s\n", url);
+ htmlf("\n");
+ exit(0);
+}
+
static void print_rel_vcs_link(const char *url)
{
html("\n");
for_each_branch_ref(print_branch_option, ctx.qry.head);
+ if (ctx.repo->enable_remote_branches)
+ for_each_remote_ref(print_branch_option, ctx.qry.head);
html(" ");
html("");
html("");