aboutsummaryrefslogtreecommitdiff
path: root/ui-tree.c
diff options
context:
space:
mode:
authorJeff Smith <whydoubt@gmail.com>2017-10-01 23:39:09 -0500
committerJohn Keeping <john@keeping.me.uk>2017-10-03 19:19:34 +0100
commit1649afdc9b2febe9ab7e1abe1956c5dcaff93aa1 (patch)
tree02c1f7371b837453b774590dbacf647c71693309 /ui-tree.c
parentc1cd290d1f83d3d1c2d081d734e8d213f12cc06b (diff)
downloadcgit-1649afdc9b2febe9ab7e1abe1956c5dcaff93aa1.tar.gz
cgit-1649afdc9b2febe9ab7e1abe1956c5dcaff93aa1.tar.bz2
cgit-1649afdc9b2febe9ab7e1abe1956c5dcaff93aa1.zip
ui-tree: link to blame UI if enabled
Create links to the blame page. Signed-off-by: Jeff Smith <whydoubt@gmail.com> Reviewed-by: John Keeping <john@keeping.me.uk>
Diffstat (limited to 'ui-tree.c')
-rw-r--r--ui-tree.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/ui-tree.c b/ui-tree.c
index 3925809..67fd1bc 100644
--- a/ui-tree.c
+++ b/ui-tree.c
@@ -1,6 +1,6 @@
/* ui-tree.c: functions for tree output
*
- * Copyright (C) 2006-2014 cgit Development Team <cgit@lists.zx2c4.com>
+ * Copyright (C) 2006-2017 cgit Development Team <cgit@lists.zx2c4.com>
*
* Licensed under GNU General Public License v2
* (see COPYING for full license text)
@@ -110,6 +110,11 @@ static void print_object(const unsigned char *sha1, char *path, const char *base
htmlf("blob: %s (", sha1_to_hex(sha1));
cgit_plain_link("plain", NULL, NULL, ctx.qry.head,
rev, path);
+ if (ctx.cfg.enable_blame) {
+ html(") (");
+ cgit_blame_link("blame", NULL, NULL, ctx.qry.head,
+ rev, path);
+ }
html(")\n");
if (ctx.cfg.max_blob_size && size / 1024 > ctx.cfg.max_blob_size) {
@@ -244,6 +249,9 @@ static int ls_item(const unsigned char *sha1, struct strbuf *base,
if (!S_ISGITLINK(mode))
cgit_plain_link("plain", NULL, "button", ctx.qry.head,
walk_tree_ctx->curr_rev, fullpath.buf);
+ if (!S_ISDIR(mode) && ctx.cfg.enable_blame)
+ cgit_blame_link("blame", NULL, "button", ctx.qry.head,
+ walk_tree_ctx->curr_rev, fullpath.buf);
html("</td></tr>\n");
free(name);
strbuf_release(&fullpath);