projects
/
geekigeeki.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
8379336
)
Upgrade gitweb
author
Bernie Innocenti
<bernie@codewiz.org>
Sun, 22 Mar 2009 23:59:28 +0000
(
00:59
+0100)
committer
Bernie Innocenti
<bernie@codewiz.org>
Sun, 22 Mar 2009 23:59:28 +0000
(
00:59
+0100)
gitweb.cgi
patch
|
blob
|
history
diff --git
a/gitweb.cgi
b/gitweb.cgi
index 643d43a5777dee77e6e865beb7c43ae0dff0ff31..962c046d4a4f52273843c2ed23fa5d90f606ba7b 100755
(executable)
--- a/
gitweb.cgi
+++ b/
gitweb.cgi
@@
-23,7
+23,7
@@
BEGIN {
}
our $cgi = new CGI;
}
our $cgi = new CGI;
-our $version = "1.6.2.
rc1.3.g81d3f
";
+our $version = "1.6.2.
103.gc4994
";
our $my_url = $cgi->url();
our $my_uri = $cgi->url(-absolute => 1);
our $my_url = $cgi->url();
our $my_uri = $cgi->url(-absolute => 1);
@@
-402,13
+402,13
@@
sub feature_bool {
my $key = shift;
my ($val) = git_get_project_config($key, '--bool');
my $key = shift;
my ($val) = git_get_project_config($key, '--bool');
- if ($val eq 'true') {
+ if (!defined $val) {
+ return ($_[0]);
+ } elsif ($val eq 'true') {
return (1);
} elsif ($val eq 'false') {
return (0);
}
return (1);
} elsif ($val eq 'false') {
return (0);
}
-
- return ($_[0]);
}
sub feature_snapshot {
}
sub feature_snapshot {
@@
-1384,13
+1384,11
@@
sub format_log_line_html {
my $line = shift;
$line = esc_html($line, -nbsp=>1);
my $line = shift;
$line = esc_html($line, -nbsp=>1);
- if ($line =~ m/\b([0-9a-fA-F]{8,40})\b/) {
- my $hash_text = $1;
- my $link =
- $cgi->a({-href => href(action=>"object", hash=>$hash_text),
- -class => "text"}, $hash_text);
- $line =~ s/$hash_text/$link/;
- }
+ $line =~ s{\b([0-9a-fA-F]{8,40})\b}{
+ $cgi->a({-href => href(action=>"object", hash=>$1),
+ -class => "text"}, $1);
+ }eg;
+
return $line;
}
return $line;
}
@@
-1914,18
+1912,19
@@
sub git_parse_project_config {
return %config;
}
return %config;
}
-# convert config value to boolean
,
'true' or 'false'
+# convert config value to boolean
:
'true' or 'false'
# no value, number > 0, 'true' and 'yes' values are true
# rest of values are treated as false (never as error)
sub config_to_bool {
my $val = shift;
# no value, number > 0, 'true' and 'yes' values are true
# rest of values are treated as false (never as error)
sub config_to_bool {
my $val = shift;
+ return 1 if !defined $val; # section.key
+
# strip leading and trailing whitespace
$val =~ s/^\s+//;
$val =~ s/\s+$//;
# strip leading and trailing whitespace
$val =~ s/^\s+//;
$val =~ s/\s+$//;
- return (!defined $val || # section.key
- ($val =~ /^\d+$/ && $val) || # section.key = 1
+ return (($val =~ /^\d+$/ && $val) || # section.key = 1
($val =~ /^(?:true|yes)$/i)); # section.key = true
}
($val =~ /^(?:true|yes)$/i)); # section.key = true
}
@@
-1978,6
+1977,9
@@
sub git_get_project_config {
$config_file = "$git_dir/config";
}
$config_file = "$git_dir/config";
}
+ # check if config variable (key) exists
+ return unless exists $config{"gitweb.$key"};
+
# ensure given type
if (!defined $type) {
return $config{"gitweb.$key"};
# ensure given type
if (!defined $type) {
return $config{"gitweb.$key"};