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>
Jakub Narebski committed
May 17, 2007 at 22:54 UTC
5f85505265601823cc228fdc94d67d3b0ba582e4
1 file changed
+2
-1
gitweb/gitweb.perl
+2
-1
@@ -2722,8 +2722,9 @@ sub git_patchset_body {
2722
delete $from{'href'};
2723
}
2724
}
2725
+
2726
$to{'file'} = $diffinfo->{'to_file'} || $diffinfo->{'file'};
2726
- if ($diffinfo->{'status'} ne "D") { # not deleted file
2727
+ if ($diffinfo->{'to_id'} ne ('0' x 40)) { # file exists in result
2728
$to{'href'} = href(action=>"blob", hash_base=>$hash,
2729
hash=>$diffinfo->{'to_id'},
2730
file_name=>$to{'file'});