gitweb: Fix error in git_patchset_body for deletion in merge commit

Checking if $diffinfo->{'status'} is equal 'D' is no longer the way to
check if the file was deleted in result.  For merge commits
$diffinfo->{'status'} is reference to array of statuses for each
parent.  Use the fact that $diffinfo->{'to_id'} is all zeros as sign
that file was deleted in result.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Jakub Narebski 2007-05-17 22:54:28 +02:00 committed by Junio C Hamano
parent e986e26a86
commit 5f85505265

View File

@ -2722,8 +2722,9 @@ sub git_patchset_body {
delete $from{'href'}; delete $from{'href'};
} }
} }
$to{'file'} = $diffinfo->{'to_file'} || $diffinfo->{'file'}; $to{'file'} = $diffinfo->{'to_file'} || $diffinfo->{'file'};
if ($diffinfo->{'status'} ne "D") { # not deleted file if ($diffinfo->{'to_id'} ne ('0' x 40)) { # file exists in result
$to{'href'} = href(action=>"blob", hash_base=>$hash, $to{'href'} = href(action=>"blob", hash_base=>$hash,
hash=>$diffinfo->{'to_id'}, hash=>$diffinfo->{'to_id'},
file_name=>$to{'file'}); file_name=>$to{'file'});