X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/39c75e7fd497954f3c009b808e6305cc31c13fab..f3eda82c08833c9e60a3a8c82acc8c97d2ba771e:/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 ($) { #{{{