gitweb: Use href(-replay=>1,...) for formats links in "commitdiff"

Use href(-replay->1,...) in (sub)navigation links (like changing style of view, or going to parent commit) so that extra options are preserved. This is needed so clicking on such (sub)navigation link would preserve style of diff; for example when using "side-by-side" diff style then going to parent commit would now also use this style. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jakub Narebski committed Oct 31, 2011 at 00:36 UTC d0e6e29ee618c730c4428a52b7eb0be54c6af17a
1 file changed +8 -8
gitweb/gitweb.perl
+8 -8
@@ -7267,8 +7267,8 @@ sub git_commitdiff {
7267 }
7268 }
7269 $formats_nav .= ': ' .
7270 - $cgi->a({-href => href(action=>"commitdiff",
7271 - hash=>$hash_parent)},
7270 + $cgi->a({-href => href(-replay=>1,
7271 + hash=>$hash_parent, hash_base=>undef)},
7272 esc_html($hash_parent_short)) .
7273 ')';
7274 } elsif (!$co{'parent'}) {
@@ -7278,28 +7278,28 @@ sub git_commitdiff {
7278 # single parent commit
7279 $formats_nav .=
7280 ' (parent: ' .
7281 - $cgi->a({-href => href(action=>"commitdiff",
7282 - hash=>$co{'parent'})},
7281 + $cgi->a({-href => href(-replay=>1,
7282 + hash=>$co{'parent'}, hash_base=>undef)},
7283 esc_html(substr($co{'parent'}, 0, 7))) .
7284 ')';
7285 } else {
7286 # merge commit
7287 if ($hash_parent eq '--cc') {
7288 $formats_nav .= ' | ' .
7289 - $cgi->a({-href => href(action=>"commitdiff",
7289 + $cgi->a({-href => href(-replay=>1,
7290 hash=>$hash, hash_parent=>'-c')},
7291 'combined');
7292 } else { # $hash_parent eq '-c'
7293 $formats_nav .= ' | ' .
7294 - $cgi->a({-href => href(action=>"commitdiff",
7294 + $cgi->a({-href => href(-replay=>1,
7295 hash=>$hash, hash_parent=>'--cc')},
7296 'compact');
7297 }
7298 $formats_nav .=
7299 ' (merge: ' .
7300 join(' ', map {
7301 - $cgi->a({-href => href(action=>"commitdiff",
7302 - hash=>$_)},
7301 + $cgi->a({-href => href(-replay=>1,
7302 + hash=>$_, hash_base=>undef)},
7303 esc_html(substr($_, 0, 7)));
7304 } @{$co{'parents'}} ) .
7305 ')';