gitweb: Fix git_blame
Signed-off-by: Junio C Hamano <junkio@cox.net>
Aneesh Kumar K.V committed
Sep 1, 2006 at 09:13 UTC
1d3fc68ae711b3f46aea02f8d819423cf8780b7d
1 file changed
+6
-4
gitweb/gitweb.perl
+6
-4
@@ -2251,7 +2251,8 @@ sub git_blame2 {
2251
my $fd;
2252
my $ftype;
2253
2254
- if (!gitweb_check_feature('blame')) {
2254
+ my ($have_blame) = gitweb_check_feature('blame');
2255
+ if (!$have_blame) {
2256
die_error('403 Permission denied', "Permission denied");
2257
}
2258
die_error('404 Not Found', "File name not defined") if (!$file_name);
@@ -2320,7 +2321,8 @@ HTML
2321
sub git_blame {
2322
my $fd;
2323
2323
- if (!gitweb_check_feature('blame')) {
2324
+ my ($have_blame) = gitweb_check_feature('blame');
2325
+ if (!$have_blame) {
2326
die_error('403 Permission denied', "Permission denied");
2327
}
2328
die_error('404 Not Found', "File name not defined") if (!$file_name);
@@ -2494,7 +2496,7 @@ sub git_blob {
2496
die_error(undef, "No file name defined");
2497
}
2498
}
2497
- my $have_blame = gitweb_check_feature('blame');
2499
+ my ($have_blame) = gitweb_check_feature('blame');
2500
open my $fd, "-|", git_cmd(), "cat-file", "blob", $hash
2501
or die_error(undef, "Couldn't cat $file_name, $hash");
2502
my $mimetype = blob_mimetype($fd, $file_name);
@@ -2570,7 +2572,7 @@ sub git_tree {
2572
my $ref = format_ref_marker($refs, $hash_base);
2573
git_header_html();
2574
my $base = "";
2573
- my $have_blame = gitweb_check_feature('blame');
2575
+ my ($have_blame) = gitweb_check_feature('blame');
2576
if (defined $hash_base && (my %co = parse_commit($hash_base))) {
2577
git_print_page_nav('tree','', $hash_base);
2578
git_print_header_div('commit', esc_html($co{'title'}) . $ref, $hash_base);