Skip to content

Commit 2206537

Browse files
jnarebJunio C Hamano
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 93c44d4 commit 2206537

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

gitweb/gitweb.perl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2660,9 +2660,10 @@ sub git_patchset_body {
26602660
# check if current patch belong to current raw line
26612661
# and parse raw git-diff line if needed
26622662
if (defined $diffinfo &&
2663+
defined $from_id && defined $to_id &&
26632664
from_ids_eq($diffinfo->{'from_id'}, $from_id) &&
26642665
$diffinfo->{'to_id'} eq $to_id) {
2665-
# this is split patch
2666+
# this is continuation of a split patch
26662667
print "<div class=\"patch cont\">\n";
26672668
} else {
26682669
# advance raw git-diff output if needed

0 commit comments

Comments
 (0)