diff options
author | Jakub Narebski <jnareb@gmail.com> | 2011-10-31 00:36:26 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-10-31 15:22:58 -0700 |
commit | d0e6e29ee618c730c4428a52b7eb0be54c6af17a (patch) | |
tree | cc3854d7f50915971ec5e63c5473f561d9d698c1 /gitweb | |
parent | t9500: Add basic sanity tests for side-by-side diff in gitweb (diff) | |
download | tgif-d0e6e29ee618c730c4428a52b7eb0be54c6af17a.tar.xz |
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>
Diffstat (limited to 'gitweb')
-rwxr-xr-x | gitweb/gitweb.perl | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index f69ed08310..ffaea451b1 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -7267,8 +7267,8 @@ sub git_commitdiff { } } $formats_nav .= ': ' . - $cgi->a({-href => href(action=>"commitdiff", - hash=>$hash_parent)}, + $cgi->a({-href => href(-replay=>1, + hash=>$hash_parent, hash_base=>undef)}, esc_html($hash_parent_short)) . ')'; } elsif (!$co{'parent'}) { @@ -7278,28 +7278,28 @@ sub git_commitdiff { # single parent commit $formats_nav .= ' (parent: ' . - $cgi->a({-href => href(action=>"commitdiff", - hash=>$co{'parent'})}, + $cgi->a({-href => href(-replay=>1, + hash=>$co{'parent'}, hash_base=>undef)}, esc_html(substr($co{'parent'}, 0, 7))) . ')'; } else { # merge commit if ($hash_parent eq '--cc') { $formats_nav .= ' | ' . - $cgi->a({-href => href(action=>"commitdiff", + $cgi->a({-href => href(-replay=>1, hash=>$hash, hash_parent=>'-c')}, 'combined'); } else { # $hash_parent eq '-c' $formats_nav .= ' | ' . - $cgi->a({-href => href(action=>"commitdiff", + $cgi->a({-href => href(-replay=>1, hash=>$hash, hash_parent=>'--cc')}, 'compact'); } $formats_nav .= ' (merge: ' . join(' ', map { - $cgi->a({-href => href(action=>"commitdiff", - hash=>$_)}, + $cgi->a({-href => href(-replay=>1, + hash=>$_, hash_base=>undef)}, esc_html(substr($_, 0, 7))); } @{$co{'parents'}} ) . ')'; |