diff options
Diffstat (limited to 'cmd.c')
-rw-r--r-- | cmd.c | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -1,6 +1,6 @@ | |||
1 | /* cmd.c: the cgit command dispatcher | 1 | /* cmd.c: the cgit command dispatcher |
2 | * | 2 | * |
3 | * Copyright (C) 2006-2014 cgit Development Team <cgit@lists.zx2c4.com> | 3 | * Copyright (C) 2006-2017 cgit Development Team <cgit@lists.zx2c4.com> |
4 | * | 4 | * |
5 | * Licensed under GNU General Public License v2 | 5 | * Licensed under GNU General Public License v2 |
6 | * (see COPYING for full license text) | 6 | * (see COPYING for full license text) |
@@ -11,6 +11,7 @@ | |||
11 | #include "cache.h" | 11 | #include "cache.h" |
12 | #include "ui-shared.h" | 12 | #include "ui-shared.h" |
13 | #include "ui-atom.h" | 13 | #include "ui-atom.h" |
14 | #include "ui-blame.h" | ||
14 | #include "ui-blob.h" | 15 | #include "ui-blob.h" |
15 | #include "ui-clone.h" | 16 | #include "ui-clone.h" |
16 | #include "ui-commit.h" | 17 | #include "ui-commit.h" |
@@ -63,6 +64,14 @@ static void about_fn(void) | |||
63 | cgit_print_site_readme(); | 64 | cgit_print_site_readme(); |
64 | } | 65 | } |
65 | 66 | ||
67 | static void blame_fn(void) | ||
68 | { | ||
69 | if (ctx.cfg.enable_blame) | ||
70 | cgit_print_blame(); | ||
71 | else | ||
72 | cgit_print_error_page(403, "Forbidden", "Blame is disabled"); | ||
73 | } | ||
74 | |||
66 | static void blob_fn(void) | 75 | static void blob_fn(void) |
67 | { | 76 | { |
68 | cgit_print_blob(ctx.qry.sha1, ctx.qry.path, ctx.qry.head, 0); | 77 | cgit_print_blob(ctx.qry.sha1, ctx.qry.path, ctx.qry.head, 0); |
@@ -164,6 +173,7 @@ struct cgit_cmd *cgit_get_cmd(void) | |||
164 | def_cmd(HEAD, 1, 0, 1), | 173 | def_cmd(HEAD, 1, 0, 1), |
165 | def_cmd(atom, 1, 0, 0), | 174 | def_cmd(atom, 1, 0, 0), |
166 | def_cmd(about, 0, 0, 0), | 175 | def_cmd(about, 0, 0, 0), |
176 | def_cmd(blame, 1, 1, 0), | ||
167 | def_cmd(blob, 1, 0, 0), | 177 | def_cmd(blob, 1, 0, 0), |
168 | def_cmd(commit, 1, 1, 0), | 178 | def_cmd(commit, 1, 1, 0), |
169 | def_cmd(diff, 1, 1, 0), | 179 | def_cmd(diff, 1, 1, 0), |