misc config updates
[distro-setup] / filesystem / usr / share / gitweb / gitweb.cgi
index 507108bf22c340d4aed012dcd2bb7c7bec67850f..ea4250feb5dbd792854226163ac098dbac0076c9 100755 (executable)
@@ -198,8 +198,6 @@ our $prevent_xss = 0;
 # [Default: highlight]
 our $highlight_bin = "highlight";
 
-our $highlight_force = 0;
-
 # information about snapshot formats that gitweb is capable of serving
 our %known_snapshot_formats = (
        # name => {
@@ -3933,12 +3931,12 @@ sub guess_file_syntax {
 # or return original FD if no highlighting
 sub run_highlighter {
        my ($fd, $highlight, $syntax) = @_;
-       return $fd unless ($highlight && (defined $syntax || $highlight_force));
+        return $fd unless ($highlight);
 
        close $fd;
-       my $syntax_arg = "--syntax $syntax";
-       if ($highlight_force) {
-           $syntax_arg = "--force"
+        my $syntax_arg = "--force";
+        if ($syntax) {
+                $syntax_arg = "--syntax $syntax";
        }
         open $fd, quote_command(git_cmd(), "cat-file", "blob", $hash)." | ".
             quote_command($^X, '-CO', '-MEncode=decode,FB_DEFAULT', '-pse',
@@ -7122,7 +7120,7 @@ sub git_blob {
                        $line = untabify($line);
                        printf qq!<div class="pre"><a id="l%i" href="%s#l%i" class="linenr">%4i</a> %s</div>\n!,
                               $nr, esc_attr(href(-replay => 1)), $nr, $nr,
-                              ($syntax || $highlight_force) ? sanitize($line) : esc_html($line, -nbsp=>1);
+                               ($highlight) ? sanitize($line) : esc_html($line, -nbsp=>1);
                }
        }
        close $fd