]> Lady’s Gitweb - Gitweb/commitdiff
gitweb: Fix error in git_patchset_body for deletion in merge commit
authorJakub Narebski <redacted>
Thu, 17 May 2007 20:54:28 +0000 (22:54 +0200)
committerLady <redacted>
Mon, 6 Apr 2026 04:07:11 +0000 (00:07 -0400)
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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
gitweb.perl

index 31152980df847bdabc4078b741d3e4910c40f883fce3ac2854e7a5f727ff2be3..43bf7440f4b627d61a969b9fe8cdcd5acc39d37493ab7820693160d7fc73c440 100755 (executable)
@@ -2723,8 +2723,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'});
This page took 0.288777 seconds and 4 git commands to generate.