summaryrefslogtreecommitdiff
path: root/gitweb
diff options
context:
space:
mode:
authorJakub Narebski <jnareb@gmail.com>2011-06-22 17:28:54 +0200
committerJunio C Hamano <gitster@pobox.com>2011-06-22 11:52:28 -0700
commit882541b87d8f7bedca824228a8ad14aed69c904e (patch)
tree5e9a52b42b018f9e3e66db5aef9cf0d8dc283752 /gitweb
parent16f20725bbcb7abbbc11e740050197b7fe8f843a (diff)
downloadgit-882541b87d8f7bedca824228a8ad14aed69c904e.tar.gz
gitweb: Clean up code in git_search_* subroutines
Replace sequence of $foo .= "bar"; $foo .= "baz"; with $foo .= "bar" . "baz"; Use href(-replay=>1, -page=>undef) for first page of a multipl-page view. Wrap some lines to reduce their length. Some lines still have more than 80 characters, but lines are shorter now. No functional changes intended. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'gitweb')
-rwxr-xr-xgitweb/gitweb.perl29
1 files changed, 16 insertions, 13 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 9d9dc0149c..80cbe66eab 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -5273,16 +5273,13 @@ sub git_search_message {
my $paging_nav = '';
if ($page > 0) {
$paging_nav .=
- $cgi->a({-href => href(action=>"search", hash=>$hash,
- searchtext=>$searchtext,
- searchtype=>$searchtype)},
- "first");
- $paging_nav .= " &sdot; " .
+ $cgi->a({-href => href(-replay=>1, page=>undef)},
+ "first") .
+ " &sdot; " .
$cgi->a({-href => href(-replay=>1, page=>$page-1),
-accesskey => "p", -title => "Alt-p"}, "prev");
} else {
- $paging_nav .= "first";
- $paging_nav .= " &sdot; prev";
+ $paging_nav .= "first &sdot; prev";
}
my $next_link = '';
if ($#commitlist >= 100) {
@@ -5327,10 +5324,13 @@ sub git_search_changes {
if (%co) {
print "</td>\n" .
"<td class=\"link\">" .
- $cgi->a({-href => href(action=>"commit", hash=>$co{'id'})}, "commit") .
+ $cgi->a({-href => href(action=>"commit", hash=>$co{'id'})},
+ "commit") .
" | " .
- $cgi->a({-href => href(action=>"tree", hash=>$co{'tree'}, hash_base=>$co{'id'})}, "tree");
- print "</td>\n" .
+ $cgi->a({-href => href(action=>"tree", hash=>$co{'tree'},
+ hash_base=>$co{'id'})},
+ "tree") .
+ "</td>\n" .
"</tr>\n";
}
@@ -5364,10 +5364,13 @@ sub git_search_changes {
if (%co) {
print "</td>\n" .
"<td class=\"link\">" .
- $cgi->a({-href => href(action=>"commit", hash=>$co{'id'})}, "commit") .
+ $cgi->a({-href => href(action=>"commit", hash=>$co{'id'})},
+ "commit") .
" | " .
- $cgi->a({-href => href(action=>"tree", hash=>$co{'tree'}, hash_base=>$co{'id'})}, "tree");
- print "</td>\n" .
+ $cgi->a({-href => href(action=>"tree", hash=>$co{'tree'},
+ hash_base=>$co{'id'})},
+ "tree") .
+ "</td>\n" .
"</tr>\n";
}