]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Rcs/git.pm
Use bzr --quiet to avoid it outputting stuff and messing up http headers. (Scott Bronson)
[ikiwiki.git] / IkiWiki / Rcs / git.pm
index 9f65e86aa37e3a63738ce3aacf0a1f9496b57daa..1882b43ef5f1c8e642b429785ca9e55af556ae48 100644 (file)
@@ -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 ($) { #{{{