summaryrefslogtreecommitdiff
path: root/gitweb
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-11-08 12:22:04 -0800
committerJunio C Hamano <junkio@cox.net>2006-11-08 12:34:25 -0800
commit2b2a8c78ea26791853cbedad3ba282475c620067 (patch)
tree08e8c9bacc7b5bf9419ea78ec4c9074c569a230e /gitweb
parent744d0ac33ab579845808b8b01e526adc4678a226 (diff)
downloadgit-2b2a8c78ea26791853cbedad3ba282475c620067.tar.gz
gitweb: do not give blame link unconditionally in diff-tree view
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'gitweb')
-rwxr-xr-xgitweb/gitweb.perl30
1 files changed, 20 insertions, 10 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index f937ee1aec..634975b3c8 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -2012,7 +2012,7 @@ sub git_print_tree_entry {
sub git_difftree_body {
my ($difftree, $hash, $parent) = @_;
-
+ my ($have_blame) = gitweb_check_feature('blame');
print "<div class=\"list_head\">\n";
if ($#{$difftree} > 10) {
print(($#{$difftree} + 1) . " files changed:\n");
@@ -2085,9 +2085,13 @@ sub git_difftree_body {
print $cgi->a({-href => href(action=>"blob", hash=>$diff{'from_id'},
hash_base=>$parent, file_name=>$diff{'file'})},
"blob") . " | ";
- print $cgi->a({-href => href(action=>"blame", hash_base=>$parent,
- file_name=>$diff{'file'})},
- "blame") . " | ";
+ if ($have_blame) {
+ print $cgi->a({-href =>
+ href(action=>"blame",
+ hash_base=>$parent,
+ file_name=>$diff{'file'})},
+ "blame") . " | ";
+ }
print $cgi->a({-href => href(action=>"history", hash_base=>$parent,
file_name=>$diff{'file'})},
"history");
@@ -2133,9 +2137,12 @@ sub git_difftree_body {
print $cgi->a({-href => href(action=>"blob", hash=>$diff{'to_id'},
hash_base=>$hash, file_name=>$diff{'file'})},
"blob") . " | ";
- print $cgi->a({-href => href(action=>"blame", hash_base=>$hash,
- file_name=>$diff{'file'})},
- "blame") . " | ";
+ if ($have_blame) {
+ print $cgi->a({-href => href(action=>"blame",
+ hash_base=>$hash,
+ file_name=>$diff{'file'})},
+ "blame") . " | ";
+ }
print $cgi->a({-href => href(action=>"history", hash_base=>$hash,
file_name=>$diff{'file'})},
"history");
@@ -2176,9 +2183,12 @@ sub git_difftree_body {
print $cgi->a({-href => href(action=>"blob", hash=>$diff{'from_id'},
hash_base=>$parent, file_name=>$diff{'from_file'})},
"blob") . " | ";
- print $cgi->a({-href => href(action=>"blame", hash_base=>$parent,
- file_name=>$diff{'from_file'})},
- "blame") . " | ";
+ if ($have_blame) {
+ print $cgi->a({-href => href(action=>"blame",
+ hash_base=>$hash,
+ file_name=>$diff{'to_file'})},
+ "blame") . " | ";
+ }
print $cgi->a({-href => href(action=>"history", hash_base=>$parent,
file_name=>$diff{'from_file'})},
"history");