]> gitweb.ps.run Git - ps-cgit/blobdiff - cgit.c
log: allow users to follow a file
[ps-cgit] / cgit.c
diff --git a/cgit.c b/cgit.c
index 8c9cfb5e87ad9343f21b6cc0b032575969e4b914..d84b4be370bb17136430ffe40b2aa1e7eb677232 100644 (file)
--- a/cgit.c
+++ b/cgit.c
@@ -152,6 +152,8 @@ static void config_cb(const char *name, const char *value)
                ctx.cfg.snapshots = cgit_parse_snapshots_mask(value);
        else if (!strcmp(name, "enable-filter-overrides"))
                ctx.cfg.enable_filter_overrides = atoi(value);
+       else if (!strcmp(name, "enable-follow-links"))
+               ctx.cfg.enable_follow_links = atoi(value);
        else if (!strcmp(name, "enable-http-clone"))
                ctx.cfg.enable_http_clone = atoi(value);
        else if (!strcmp(name, "enable-index-links"))
@@ -333,6 +335,8 @@ static void querystring_cb(const char *name, const char *value)
                ctx.qry.context = atoi(value);
        } else if (!strcmp(name, "ignorews")) {
                ctx.qry.ignorews = atoi(value);
+       } else if (!strcmp(name, "follow")) {
+               ctx.qry.follow = atoi(value);
        }
 }
 
@@ -421,7 +425,7 @@ struct refmatch {
        int match;
 };
 
-static int find_current_ref(const char *refname, const unsigned char *sha1,
+static int find_current_ref(const char *refname, const struct object_id *oid,
                            int flags, void *cb_data)
 {
        struct refmatch *info;
@@ -742,6 +746,9 @@ static void process_request(void)
        if (ctx.repo && prepare_repo_cmd())
                return;
 
+       if (cmd->pre)
+               cmd->pre();
+
        if (cmd->want_layout) {
                cgit_print_http_headers();
                cgit_print_docstart();