Skip to content

Commit d0e6e29

Browse files
jnarebgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 1e706ec commit d0e6e29

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

gitweb/gitweb.perl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7267,8 +7267,8 @@ sub git_commitdiff {
72677267
}
72687268
}
72697269
$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)},
72727272
esc_html($hash_parent_short)) .
72737273
')';
72747274
} elsif (!$co{'parent'}) {
@@ -7278,28 +7278,28 @@ sub git_commitdiff {
72787278
# single parent commit
72797279
$formats_nav .=
72807280
' (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)},
72837283
esc_html(substr($co{'parent'}, 0, 7))) .
72847284
')';
72857285
} else {
72867286
# merge commit
72877287
if ($hash_parent eq '--cc') {
72887288
$formats_nav .= ' | ' .
7289-
$cgi->a({-href => href(action=>"commitdiff",
7289+
$cgi->a({-href => href(-replay=>1,
72907290
hash=>$hash, hash_parent=>'-c')},
72917291
'combined');
72927292
} else { # $hash_parent eq '-c'
72937293
$formats_nav .= ' | ' .
7294-
$cgi->a({-href => href(action=>"commitdiff",
7294+
$cgi->a({-href => href(-replay=>1,
72957295
hash=>$hash, hash_parent=>'--cc')},
72967296
'compact');
72977297
}
72987298
$formats_nav .=
72997299
' (merge: ' .
73007300
join(' ', map {
7301-
$cgi->a({-href => href(action=>"commitdiff",
7302-
hash=>$_)},
7301+
$cgi->a({-href => href(-replay=>1,
7302+
hash=>$_, hash_base=>undef)},
73037303
esc_html(substr($_, 0, 7)));
73047304
} @{$co{'parents'}} ) .
73057305
')';

0 commit comments

Comments
 (0)