X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/fc4c1b7ec819cf8e73f2efba05606e575eaf47a5..98844314c30f13fbcd46c8c1ca92b45b3e50a0a5:/IkiWiki/Rcs/git.pm diff --git a/IkiWiki/Rcs/git.pm b/IkiWiki/Rcs/git.pm index 9f65e86aa..1882b43ef 100644 --- a/IkiWiki/Rcs/git.pm +++ b/IkiWiki/Rcs/git.pm @@ -414,7 +414,18 @@ sub rcs_recentchanges ($) { #{{{ sub rcs_diff ($) { #{{{ my $rev=shift; my ($sha1) = $rev =~ /^($sha1_pattern)$/; # untaint - return join("\n", run_or_non("git", "diff", "$sha1^", $sha1)); + my @lines; + foreach my $line (run_or_non("git", "show", $sha1)) { + if (@lines || $line=~/^diff --git/) { + push @lines, $line."\n"; + } + } + if (wantarray) { + return @lines; + } + else { + return join("", @lines); + } } #}}} sub rcs_getctime ($) { #{{{