{"thread":{"id":"8195","subject":"[PATCH] gitweb: Fix error in git_patchset_body for deletion in merge commit","startedAt":"2007-05-17T20:54:28Z","lastAt":"2007-05-17T20:54:28Z","messageCount":1,"participants":["Jakub Narebski"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"42437","messageId":"200705172254.29021.jnareb@gmail.com","threadId":"8195","inReplyTo":null,"subject":"[PATCH] gitweb: Fix error in git_patchset_body for deletion in merge commit","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-05-17T20:54:28Z","receivedAt":"2007-05-17T20:54:28Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Checking if $diffinfo->{'status'} is equal 'D' is no longer the way to\ncheck if the file was deleted in result.  For merge commits\n$diffinfo->{'status'} is reference to array of statuses for each\nparent.  Use the fact that $diffinfo->{'to_id'} is all zeros as sign\nthat file was deleted in result.\n\nSigned-off-by: Jakub Narebski <jnareb@gmail.com>\n---\n gitweb/gitweb.perl |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 8c688be..fa8cc02 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -2720,8 +2720,9 @@ sub git_patchset_body {\n \t\t\t\t\tdelete $from{'href'};\n \t\t\t\t}\n \t\t\t}\n+\n \t\t\t$to{'file'} = $diffinfo->{'to_file'} || $diffinfo->{'file'};\n-\t\t\tif ($diffinfo->{'status'} ne \"D\") { # not deleted file\n+\t\t\tif ($diffinfo->{'to_id'} ne ('0' x 40)) { # file exists in result\n \t\t\t\t$to{'href'} = href(action=>\"blob\", hash_base=>$hash,\n \t\t\t\t                   hash=>$diffinfo->{'to_id'},\n \t\t\t\t                   file_name=>$to{'file'});\n-- \n1.5.1.4\n"}]}