summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt McCutchen <hashproduct@gmail.com>2007-06-28 18:57:07 (GMT)
committerJunio C Hamano <gitster@pobox.com>2007-07-07 21:18:29 (GMT)
commit40375a83d2bc3e2c86f998fe47fef573502a9922 (patch)
tree3dd4219762e05f94b8d7372351e0dda70bd9060a
parent76e4f5d025d80479c3a01ed9c65b024e9b80d931 (diff)
downloadgit-40375a83d2bc3e2c86f998fe47fef573502a9922.zip
git-40375a83d2bc3e2c86f998fe47fef573502a9922.tar.gz
git-40375a83d2bc3e2c86f998fe47fef573502a9922.tar.bz2
gitweb: make search form generate pathinfo-style URLs
The search form generated traditional-style URLs with a "p=" parameter even when the pathinfo feature was on. This patch makes it generate pathinfo-style URLs when appropriate. Signed-off-by: Matt McCutchen <hashproduct@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-xgitweb/gitweb.perl12
1 files changed, 9 insertions, 3 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 9d728d7..4eb7832 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -2213,12 +2213,18 @@ EOF
} else {
$search_hash = "HEAD";
}
+ my $action = $my_uri;
+ my ($use_pathinfo) = gitweb_check_feature('pathinfo');
+ if ($use_pathinfo) {
+ $action .= "/$project";
+ } else {
+ $cgi->param("p", $project);
+ }
$cgi->param("a", "search");
$cgi->param("h", $search_hash);
- $cgi->param("p", $project);
- print $cgi->startform(-method => "get", -action => $my_uri) .
+ print $cgi->startform(-method => "get", -action => $action) .
"<div class=\"search\">\n" .
- $cgi->hidden(-name => "p") . "\n" .
+ (!$use_pathinfo && $cgi->hidden(-name => "p") . "\n") .
$cgi->hidden(-name => "a") . "\n" .
$cgi->hidden(-name => "h") . "\n" .
$cgi->popup_menu(-name => 'st', -default => 'commit',