]> git.cameronkatri.com Git - cgit.git/blobdiff - cgit.c
ui-blame: Break out emit_blame_entry into component methods
[cgit.git] / cgit.c
diff --git a/cgit.c b/cgit.c
index 1075753e15b4de5672aa8445fcc86ef4e7079a92..a3702c26a6781d1cbeeb888da8f9390ff966a61c 100644 (file)
--- a/cgit.c
+++ b/cgit.c
@@ -167,6 +167,8 @@ static void config_cb(const char *name, const char *value)
                ctx.cfg.enable_index_links = atoi(value);
        else if (!strcmp(name, "enable-index-owner"))
                ctx.cfg.enable_index_owner = atoi(value);
+       else if (!strcmp(name, "enable-blame"))
+               ctx.cfg.enable_blame = atoi(value);
        else if (!strcmp(name, "enable-commit-graph"))
                ctx.cfg.enable_commit_graph = atoi(value);
        else if (!strcmp(name, "enable-log-filecount"))
@@ -476,7 +478,7 @@ static char *guess_defbranch(void)
        const char *ref, *refname;
        struct object_id oid;
 
-       ref = resolve_ref_unsafe("HEAD", 0, oid.hash, NULL);
+       ref = resolve_ref_unsafe("HEAD", 0, &oid, NULL);
        if (!ref || !skip_prefix(ref, "refs/heads/", &refname))
                return "master";
        return xstrdup(refname);
@@ -726,18 +728,18 @@ static void process_request(void)
                return;
        }
 
-       /* If cmd->want_vpath is set, assume ctx.qry.path contains a "virtual"
-        * in-project path limit to be made available at ctx.qry.vpath.
-        * Otherwise, no path limit is in effect (ctx.qry.vpath = NULL).
-        */
-       ctx.qry.vpath = cmd->want_vpath ? ctx.qry.path : NULL;
-
        if (cmd->want_repo && !ctx.repo) {
                cgit_print_error_page(400, "Bad request",
                                "No repository selected");
                return;
        }
 
+       /* If cmd->want_vpath is set, assume ctx.qry.path contains a "virtual"
+        * in-project path limit to be made available at ctx.qry.vpath.
+        * Otherwise, no path limit is in effect (ctx.qry.vpath = NULL).
+        */
+       ctx.qry.vpath = cmd->want_vpath ? ctx.qry.path : NULL;
+
        if (ctx.repo && prepare_repo_cmd())
                return;