summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 756d2f0)
raw | patch | inline | side by side (parent: 756d2f0)
author | Martin Waitz <tali@admingilde.org> | |
Wed, 16 Aug 2006 22:28:38 +0000 (00:28 +0200) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Thu, 17 Aug 2006 10:04:46 +0000 (03:04 -0700) |
The "fp" (file name parent) parameter was previously generated for
blob diffs of renamed files. However, it was not used in any code.
Now href() can generate "fp" parameters and they are used by the
blobdiff code to show the correct file name.
Signed-off-by: Martin Waitz <tali@admingilde.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
blob diffs of renamed files. However, it was not used in any code.
Now href() can generate "fp" parameters and they are used by the
blobdiff code to show the correct file name.
Signed-off-by: Martin Waitz <tali@admingilde.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
gitweb/gitweb.perl | patch | blob | history |
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 4bffbf27f37a54344985a32bbca462c2510a9e03..43285798e9beb0653278e42065bd829dd83d28bc 100755 (executable)
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
}
}
+our $file_parent = $cgi->param('fp');
+if (defined $file_parent) {
+ if (!validate_input($file_parent)) {
+ die_error(undef, "Invalid file parent parameter");
+ }
+}
+
our $hash = $cgi->param('h');
if (defined $hash) {
if (!validate_input($hash)) {
action => "a",
project => "p",
file_name => "f",
+ file_parent => "fp",
hash => "h",
hash_parent => "hp",
hash_base => "hb",
$cgi->a({-href => href(action=>"blob", hash=>$to_id, hash_base=>$hash, file_name=>$to_file)}, "blob");
if ($to_id ne $from_id) {
print " | " .
- $cgi->a({-href => "$my_uri?" .
- esc_param("p=$project;a=blobdiff;h=$to_id;hp=$from_id;hb=$hash;f=$to_file;fp=$from_file")}, "diff");
+ $cgi->a({-href => href(action=>"blobdiff", hash=>$to_id, hash_parent=>$from_id, hash_base=>$hash, file_name=>$to_file, file_parent=>$from_file)}, "diff");
}
print "</td>\n";
$cgi->a({-href => href(action=>"blob", hash=>$to_id, hash_base=>$hash, file_name=>$to_file)}, "blob");
if ($to_id ne $from_id) {
print " | " .
- $cgi->a({-href => "$my_uri?" .
- esc_param("p=$project;a=blobdiff;h=$to_id;hp=$from_id;hb=$hash;f=$to_file;fp=$from_file")}, "diff");
+ $cgi->a({-href => href(action=>"blobdiff", hash=>$to_id, hash_parent=>$from_id, hash_base=>$hash, file_name=>$to_file, file_parent=>$from_file)}, "diff");
}
print "</td>\n";
} # we should not encounter Unmerged (U) or Unknown (X) status
git_print_page_path($file_name, "blob");
print "<div class=\"page_body\">\n" .
"<div class=\"diff_info\">blob:" .
- $cgi->a({-href => href(action=>"blob", hash=>$hash_parent, hash_base=>$hash_base, file_name=>$file_name)}, $hash_parent) .
+ $cgi->a({-href => href(action=>"blob", hash=>$hash_parent, hash_base=>$hash_base, file_name=>($file_parent || $file_name))}, $hash_parent) .
" -> blob:" .
$cgi->a({-href => href(action=>"blob", hash=>$hash, hash_base=>$hash_base, file_name=>$file_name)}, $hash) .
"</div>\n";