]> gitweb.ps.run Git - ps-cgit/blobdiff - ui-shared.c
about: always ensure page has a trailing slash
[ps-cgit] / ui-shared.c
index ac5a2871e3625fb3c4d6a5e1f30cb1bb65561022..4f84b7c60e8570331353961497f1df7db340c106 100644 (file)
@@ -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("<link rel='vcs-git' href='");
@@ -792,7 +800,7 @@ void cgit_add_clone_urls(void (*fn)(const char *))
                add_clone_urls(fn, ctx.cfg.clone_prefix, ctx.repo->url);
 }
 
-static int print_branch_option(const char *refname, const unsigned char *sha1,
+static int print_branch_option(const char *refname, const struct object_id *oid,
                               int flags, void *cb_data)
 {
        char *name = (char *)refname;