gitweb: git_tree displays blame based on repository config
git_tree() will now conditionally display "blame" depending on how "gitweb.blame" variable is configured using "git-repo-config". Signed-off-by: Luben Tuikov <ltuikov@yahoo.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:

committed by
Junio C Hamano

parent
06c084d28b
commit
f9f02d0129
@ -1757,6 +1757,7 @@ sub git_tree {
|
|||||||
git_header_html();
|
git_header_html();
|
||||||
my $base_key = "";
|
my $base_key = "";
|
||||||
my $base = "";
|
my $base = "";
|
||||||
|
my $have_blame = git_get_project_config_bool ('blame');
|
||||||
if (defined $hash_base && (my %co = git_read_commit($hash_base))) {
|
if (defined $hash_base && (my %co = git_read_commit($hash_base))) {
|
||||||
$base_key = ";hb=$hash_base";
|
$base_key = ";hb=$hash_base";
|
||||||
git_page_nav('tree','', $hash_base);
|
git_page_nav('tree','', $hash_base);
|
||||||
@ -1792,9 +1793,11 @@ sub git_tree {
|
|||||||
$cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob;h=$t_hash$base_key;f=$base$t_name"), -class => "list"}, esc_html($t_name)) .
|
$cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob;h=$t_hash$base_key;f=$base$t_name"), -class => "list"}, esc_html($t_name)) .
|
||||||
"</td>\n" .
|
"</td>\n" .
|
||||||
"<td class=\"link\">" .
|
"<td class=\"link\">" .
|
||||||
$cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob;h=$t_hash$base_key;f=$base$t_name")}, "blob") .
|
$cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob;h=$t_hash$base_key;f=$base$t_name")}, "blob");
|
||||||
# " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blame;h=$t_hash$base_key;f=$base$t_name")}, "blame") .
|
if ($have_blame) {
|
||||||
" | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=history;h=$t_hash;hb=$hash_base;f=$base$t_name")}, "history") .
|
print " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blame;h=$t_hash$base_key;f=$base$t_name")}, "blame");
|
||||||
|
}
|
||||||
|
print " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=history;h=$t_hash;hb=$hash_base;f=$base$t_name")}, "history") .
|
||||||
" | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob_plain;h=$t_hash;f=$base$t_name")}, "raw") .
|
" | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob_plain;h=$t_hash;f=$base$t_name")}, "raw") .
|
||||||
"</td>\n";
|
"</td>\n";
|
||||||
} elsif ($t_type eq "tree") {
|
} elsif ($t_type eq "tree") {
|
||||||
|
Reference in New Issue
Block a user