gitweb: Remove parse_from_to_diffinfo code from git_patchset_body
In commit 90921740bd00029708370673fdc537522aa48e6f "gitweb: Split git_patchset_body into separate subroutines" a part of git_patchset_body code was separated into parse_from_to_diffinfo subroutine. But instead of replacing the separated code by the call to mentioned subroutine, the call to subroutine was placed before the separated code. This patch removes parse_from_to_diffinfo code from git_patchset_body subroutine. Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Jakub Narebski committed
Sep 8, 2007 at 21:49 UTC
711fa74266ebfaf58ee0cd79988748fbaa752538
1 file changed
+1
-35
gitweb/gitweb.perl
+1
-35
@@ -3191,44 +3191,10 @@ sub git_patchset_body {
3191
}
3192
} until (!defined $to_name || $to_name eq $diffinfo->{'to_file'} ||
3193
$patch_idx > $#$difftree);
3194
+
3195
# modifies %from, %to hashes
3196
parse_from_to_diffinfo($diffinfo, \%from, \%to, @hash_parents);
3196
- if ($diffinfo->{'nparents'}) {
3197
- # combined diff
3198
- $from{'file'} = [];
3199
- $from{'href'} = [];
3200
- fill_from_file_info($diffinfo, @hash_parents)
3201
- unless exists $diffinfo->{'from_file'};
3202
- for (my $i = 0; $i < $diffinfo->{'nparents'}; $i++) {
3203
- $from{'file'}[$i] = $diffinfo->{'from_file'}[$i] || $diffinfo->{'to_file'};
3204
- if ($diffinfo->{'status'}[$i] ne "A") { # not new (added) file
3205
- $from{'href'}[$i] = href(action=>"blob",
3206
- hash_base=>$hash_parents[$i],
3207
- hash=>$diffinfo->{'from_id'}[$i],
3208
- file_name=>$from{'file'}[$i]);
3209
- } else {
3210
- $from{'href'}[$i] = undef;
3211
- }
3212
- }
3213
- } else {
3214
- $from{'file'} = $diffinfo->{'from_file'} || $diffinfo->{'file'};
3215
- if ($diffinfo->{'status'} ne "A") { # not new (added) file
3216
- $from{'href'} = href(action=>"blob", hash_base=>$hash_parent,
3217
- hash=>$diffinfo->{'from_id'},
3218
- file_name=>$from{'file'});
3219
- } else {
3220
- delete $from{'href'};
3221
- }
3222
- }
3197
3224
- $to{'file'} = $diffinfo->{'to_file'} || $diffinfo->{'file'};
3225
- if (!is_deleted($diffinfo)) { # file exists in result
3226
- $to{'href'} = href(action=>"blob", hash_base=>$hash,
3227
- hash=>$diffinfo->{'to_id'},
3228
- file_name=>$to{'file'});
3229
- } else {
3230
- delete $to{'href'};
3231
- }
3198
# this is first patch for raw difftree line with $patch_idx index
3199
# we index @$difftree array from 0, but number patches from 1
3200
print "<div class=\"patch\" id=\"patch". ($patch_idx+1) ."\">\n";