From: Joey Hess Date: Fri, 5 Sep 2008 18:26:29 +0000 (-0400) Subject: gitweb: avoid warnings for commits without body X-Git-Url: https://git.ladys.computer/Gitweb/commitdiff_plain/17dd3d57d8963de0d2bb2f5be73011a1357786dfe1021ca8018b58060e227998 gitweb: avoid warnings for commits without body In the unusual case when there is no commit message, gitweb would output an uninitialized value warning. Signed-off-by: Joey Hess Acked-by: Jakub Narebski Signed-off-by: Junio C Hamano --- diff --git a/gitweb.perl b/gitweb.perl index c763d1d..95a3415 100755 --- a/gitweb.perl +++ b/gitweb.perl @@ -2124,7 +2124,7 @@ sub parse_commit_text { last; } } - if ($co{'title'} eq "") { + if (! defined $co{'title'} || $co{'title'} eq "") { $co{'title'} = $co{'title_short'} = '(no commit message)'; } # remove added spaces