aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki/Rcs/git.pm
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2008-07-17 16:53:54 -0400
committerJoey Hess <joey@kodama.kitenet.net>2008-07-17 16:53:54 -0400
commit1b318dacbda00d05566f300bb4a69cd913ce0e71 (patch)
tree1b8f4d5091eeb1e30624d2f8a03074fc3d355d02 /IkiWiki/Rcs/git.pm
parentf66eddccc688059fee94b4b7789318e39675d34c (diff)
downloadikiwiki-1b318dacbda00d05566f300bb4a69cd913ce0e71.tar
ikiwiki-1b318dacbda00d05566f300bb4a69cd913ce0e71.tar.gz
git: Fix parsing of git logs with no commit messages at all.
Diffstat (limited to 'IkiWiki/Rcs/git.pm')
-rw-r--r--IkiWiki/Rcs/git.pm14
1 files changed, 6 insertions, 8 deletions
diff --git a/IkiWiki/Rcs/git.pm b/IkiWiki/Rcs/git.pm
index c816d1bb5..26f2a39f2 100644
--- a/IkiWiki/Rcs/git.pm
+++ b/IkiWiki/Rcs/git.pm
@@ -197,7 +197,7 @@ sub _parse_diff_tree ($@) { #{{{
}
debug("No 'tree' seen in diff-tree output") if !defined $ci{'tree'};
-
+
if (defined $ci{'parents'}) {
$ci{'parent'} = @{ $ci{'parents'} }[0];
}
@@ -205,15 +205,13 @@ sub _parse_diff_tree ($@) { #{{{
$ci{'parent'} = 0 x 40;
}
- # Commit message.
- while (my $line = shift @{ $dt_ref }) {
- if ($line =~ m/^$/) {
- # Trailing empty line signals next section.
- last;
- };
+ # Commit message (optional).
+ while ($dt_ref->[0] =~ /^ /) {
+ my $line = shift @{ $dt_ref };
$line =~ s/^ //;
push @{ $ci{'comment'} }, $line;
}
+ shift @{ $dt_ref } if $dt_ref->[0] =~ /^$/;
# Modified files.
while (my $line = shift @{ $dt_ref }) {
@@ -360,7 +358,7 @@ sub rcs_recentchanges ($) { #{{{
my @rets;
foreach my $ci (git_commit_info('HEAD', $num)) {
# Skip redundant commits.
- next if (@{$ci->{'comment'}}[0] eq $dummy_commit_msg);
+ next if ($ci->{'comment'} && @{$ci->{'comment'}}[0] eq $dummy_commit_msg);
my ($sha1, $when) = (
$ci->{'sha1'},