From mboxrd@z Thu Jan 1 00:00:00 1970 From: whydoubt at gmail.com (Jeff Smith) Date: Fri, 22 Sep 2017 22:38:48 -0500 Subject: [RFCv2 PATCH 7/7] ui-blame: generate blame page when requested In-Reply-To: <20170923033848.5922-1-whydoubt@gmail.com> References: <20170608021810.12964-1-whydoubt@gmail.com> <20170923033848.5922-1-whydoubt@gmail.com> Message-ID: <20170923033848.5922-8-whydoubt@gmail.com> Signed-off-by: Jeff Smith --- cmd.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/cmd.c b/cmd.c index d280e95..63f0ae5 100644 --- a/cmd.c +++ b/cmd.c @@ -1,6 +1,6 @@ /* cmd.c: the cgit command dispatcher * - * Copyright (C) 2006-2014 cgit Development Team + * Copyright (C) 2006-2017 cgit Development Team * * Licensed under GNU General Public License v2 * (see COPYING for full license text) @@ -11,6 +11,7 @@ #include "cache.h" #include "ui-shared.h" #include "ui-atom.h" +#include "ui-blame.h" #include "ui-blob.h" #include "ui-clone.h" #include "ui-commit.h" @@ -63,6 +64,14 @@ static void about_fn(void) cgit_print_site_readme(); } +static void blame_fn(void) +{ + if (ctx.cfg.enable_blame) + cgit_print_blame(); + else + cgit_print_error_page(403, "Forbidden", "Blame is disabled"); +} + static void blob_fn(void) { cgit_print_blob(ctx.qry.sha1, ctx.qry.path, ctx.qry.head, 0); @@ -164,6 +173,7 @@ struct cgit_cmd *cgit_get_cmd(void) def_cmd(HEAD, 1, 0, 1), def_cmd(atom, 1, 0, 0), def_cmd(about, 0, 0, 0), + def_cmd(blame, 1, 1, 0), def_cmd(blob, 1, 0, 0), def_cmd(commit, 1, 1, 0), def_cmd(diff, 1, 1, 0), -- 2.9.4