Skip to content

Commit

Permalink
gitweb: Fix error in git_patchset_body for deletion in merge commit
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jakub Narebski authored and Junio C Hamano committed May 18, 2007
1 parent e986e26 commit 5f85505
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gitweb/gitweb.perl
Original file line number Diff line number Diff line change
Expand Up @@ -2722,8 +2722,9 @@ sub git_patchset_body {
delete $from{'href'};
}
}

$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,
hash=>$diffinfo->{'to_id'},
file_name=>$to{'file'});
Expand Down

0 comments on commit 5f85505

Please sign in to comment.