All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gitweb: Fix error in git_patchset_body for deletion in merge commit
@ 2007-05-17 20:54 Jakub Narebski
  0 siblings, 0 replies; only message in thread
From: Jakub Narebski @ 2007-05-17 20:54 UTC (permalink / raw)
  To: git

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>
---
 gitweb/gitweb.perl |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 8c688be..fa8cc02 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -2720,8 +2720,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'});
-- 
1.5.1.4

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2007-05-17 22:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-17 20:54 [PATCH] gitweb: Fix error in git_patchset_body for deletion in merge commit Jakub Narebski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.