aboutsummaryrefslogtreecommitdiff
path: root/gitweb
diff options
context:
space:
mode:
authorJakub Narebski <jnareb@gmail.com>2007-05-12 12:42:32 +0200
committerJunio C Hamano <junkio@cox.net>2007-05-12 09:19:08 -0700
commit2206537c07973fc2933092313d95340e076440e4 (patch)
tree51cab266407b12fb1ba6b43ef789c5edd10c3304 /gitweb
parent93c44d493b8c98b9bb74e4f78aa90ee20a01f078 (diff)
downloadgit-2206537c07973fc2933092313d95340e076440e4.tar.gz
git-2206537c07973fc2933092313d95340e076440e4.tar.xz
gitweb: Test if $from_id and $to_id are defined before comparison
Get rid of "Use of uninitialized value in string eq at gitweb/gitweb.perl line 2320" warning caused by the fact that "empty" patches, consisting only of extended git diff header and with patch body empty, such as patch for pure rename, does not have "index" line in extended diff header. For such patches $from_id and $to_id, filled from parsing extended diff header, are undefined. But such patches cannot be continuation patches. Test if $from_id and $to_id are defined before comparing them with $diffinfo. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'gitweb')
-rwxr-xr-xgitweb/gitweb.perl3
1 files changed, 2 insertions, 1 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 21864c62a..fff01834d 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -2660,9 +2660,10 @@ sub git_patchset_body {
# check if current patch belong to current raw line
# and parse raw git-diff line if needed
if (defined $diffinfo &&
+ defined $from_id && defined $to_id &&
from_ids_eq($diffinfo->{'from_id'}, $from_id) &&
$diffinfo->{'to_id'} eq $to_id) {
- # this is split patch
+ # this is continuation of a split patch
print "<div class=\"patch cont\">\n";
} else {
# advance raw git-diff output if needed