- %diffinfo = parse_difftree_raw_line($difftree->[$patch_idx++]);
+ if (ref($difftree->[$patch_idx]) eq "HASH") {
+ $diffinfo = $difftree->[$patch_idx];
+ } else {
+ $diffinfo = parse_difftree_raw_line($difftree->[$patch_idx]);
+ }
+ $patch_idx++;
# for now, no extended header, hence we skip empty patches
# companion to next LINE if $in_header;
# for now, no extended header, hence we skip empty patches
# companion to next LINE if $in_header;
- if ($diffinfo{'status'} eq "A") { # added
- print "<div class=\"diff_info\">" . file_type($diffinfo{'to_mode'}) . ":" .
+ if ($diffinfo->{'status'} eq "A") { # added
+ print "<div class=\"diff_info\">" . file_type($diffinfo->{'to_mode'}) . ":" .
- hash=>$diffinfo{'to_id'}, file_name=>$diffinfo{'file'})},
- $diffinfo{'to_id'}) . "(new)" .
+ hash=>$diffinfo->{'to_id'}, file_name=>$diffinfo->{'file'})},
+ $diffinfo->{'to_id'}) . "(new)" .
- } elsif ($diffinfo{'status'} eq "D") { # deleted
- print "<div class=\"diff_info\">" . file_type($diffinfo{'from_mode'}) . ":" .
+ } elsif ($diffinfo->{'status'} eq "D") { # deleted
+ print "<div class=\"diff_info\">" . file_type($diffinfo->{'from_mode'}) . ":" .
- hash=>$diffinfo{'from_id'}, file_name=>$diffinfo{'file'})},
- $diffinfo{'from_id'}) . "(deleted)" .
+ hash=>$diffinfo->{'from_id'}, file_name=>$diffinfo->{'file'})},
+ $diffinfo->{'from_id'}) . "(deleted)" .
- hash=>$diffinfo{'from_id'}, file_name=>$diffinfo{'from_file'})},
- $diffinfo{'from_id'}) .
+ hash=>$diffinfo->{'from_id'}, file_name=>$diffinfo->{'from_file'})},
+ $diffinfo->{'from_id'}) .
print "</div>\n"; # class="diff_info"
} else { # modified, mode changed, ...
print "<div class=\"diff_info\">" .
print "</div>\n"; # class="diff_info"
} else { # modified, mode changed, ...
print "<div class=\"diff_info\">" .
- hash=>$diffinfo{'from_id'}, file_name=>$diffinfo{'file'})},
- $diffinfo{'from_id'}) .
+ hash=>$diffinfo->{'from_id'}, file_name=>$diffinfo->{'file'})},
+ $diffinfo->{'from_id'}) .