Skip to content

Commit 711fa74

Browse files
jnarebgitster
authored andcommitted
gitweb: Remove parse_from_to_diffinfo code from git_patchset_body
In commit 9092174 "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>
1 parent 15eda02 commit 711fa74

File tree

1 file changed

+1
-35
lines changed

1 file changed

+1
-35
lines changed

gitweb/gitweb.perl

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -3191,44 +3191,10 @@ sub git_patchset_body {
31913191
}
31923192
} until (!defined $to_name || $to_name eq $diffinfo->{'to_file'} ||
31933193
$patch_idx > $#$difftree);
3194+
31943195
# modifies %from, %to hashes
31953196
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-
}
32233197

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-
}
32323198
# this is first patch for raw difftree line with $patch_idx index
32333199
# we index @$difftree array from 0, but number patches from 1
32343200
print "<div class=\"patch\" id=\"patch". ($patch_idx+1) ."\">\n";

0 commit comments

Comments
 (0)