diff options
author | Jakub Narebski <jnareb@gmail.com> | 2006-08-25 21:15:27 +0200 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-08-25 19:42:33 -0700 |
commit | 8cce8e3ddb2c2f7e0ab028012ae4dc729c8bf3f9 (patch) | |
tree | ce7734ad27e7c00b314733936372aeab51ebed45 /gitweb | |
parent | 9b71b1f6b3b57b3771151d252a5e22886524a154 (diff) | |
download | git-8cce8e3ddb2c2f7e0ab028012ae4dc729c8bf3f9.tar.gz |
gitweb: Remove git_diff_print subroutine
Remove git_diff_print subroutine, used to print diff in previous
versions of "diff" actions, namely git_commitdiff,
git_commitdiff_plain, git_blobdiff, git_blobdiff_plain.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'gitweb')
-rwxr-xr-x | gitweb/gitweb.perl | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index 11b3fdc178..35f0da1ba7 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -1975,77 +1975,6 @@ sub git_heads_body { print "</table>\n"; } -## ---------------------------------------------------------------------- -## functions printing large fragments, format as one of arguments - -sub git_diff_print { - my $from = shift; - my $from_name = shift; - my $to = shift; - my $to_name = shift; - my $format = shift || "html"; - - my $from_tmp = "/dev/null"; - my $to_tmp = "/dev/null"; - my $pid = $$; - - # create tmp from-file - if (defined $from) { - $from_tmp = "$git_temp/gitweb_" . $$ . "_from"; - open my $fd2, "> $from_tmp"; - open my $fd, "-|", $GIT, "cat-file", "blob", $from; - my @file = <$fd>; - print $fd2 @file; - close $fd2; - close $fd; - } - - # create tmp to-file - if (defined $to) { - $to_tmp = "$git_temp/gitweb_" . $$ . "_to"; - open my $fd2, "> $to_tmp"; - open my $fd, "-|", $GIT, "cat-file", "blob", $to; - my @file = <$fd>; - print $fd2 @file; - close $fd2; - close $fd; - } - - open my $fd, "-|", "/usr/bin/diff -u -p -L \'$from_name\' -L \'$to_name\' $from_tmp $to_tmp"; - if ($format eq "plain") { - undef $/; - print <$fd>; - $/ = "\n"; - } else { - while (my $line = <$fd>) { - chomp $line; - my $char = substr($line, 0, 1); - my $diff_class = ""; - if ($char eq '+') { - $diff_class = " add"; - } elsif ($char eq "-") { - $diff_class = " rem"; - } elsif ($char eq "@") { - $diff_class = " chunk_header"; - } elsif ($char eq "\\") { - # skip errors - next; - } - $line = untabify($line); - print "<div class=\"diff$diff_class\">" . esc_html($line) . "</div>\n"; - } - } - close $fd; - - if (defined $from) { - unlink($from_tmp); - } - if (defined $to) { - unlink($to_tmp); - } -} - - ## ====================================================================== ## ====================================================================== ## actions |