]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/git.pm
If the title of a trail or trail-member changes, rebuild affected pages
[ikiwiki.git] / IkiWiki / Plugin / git.pm
index 535cd5fe0f64d23d46a233a388264f88912e1c6d..3879abeae5b20e05d4f9c2990c270c6943982b65 100644 (file)
@@ -341,8 +341,8 @@ sub parse_diff_tree ($) {
        my $dt_ref = shift;
 
        # End of stream?
-       return if !defined @{ $dt_ref } ||
-                 !defined @{ $dt_ref }[0] || !length @{ $dt_ref }[0];
+       return if ! @{ $dt_ref } ||
+                 !defined $dt_ref->[0] || !length $dt_ref->[0];
 
        my %ci;
        # Header line.
@@ -469,13 +469,10 @@ sub git_sha1 (;$) {
        # Ignore error since a non-existing file might be given.
        my ($sha1) = run_or_non('git', 'rev-list', '--max-count=1', 'HEAD',
                '--', $file);
-       if ($sha1) {
+       if (defined $sha1) {
                ($sha1) = $sha1 =~ m/($sha1_pattern)/; # sha1 is untainted now
        }
-       else {
-               debug("Empty sha1sum for '$file'.");
-       }
-       return defined $sha1 ? $sha1 : q{};
+       return defined $sha1 ? $sha1 : '';
 }
 
 sub rcs_update () {