Code

gitweb: avoid warnings for commits without body
authorJoey Hess <joey@kitenet.net>
Fri, 5 Sep 2008 18:26:29 +0000 (14:26 -0400)
committerJunio C Hamano <gitster@pobox.com>
Fri, 19 Sep 2008 02:48:19 +0000 (19:48 -0700)
In the unusual case when there is no commit message, gitweb would
output an uninitialized value warning.

Signed-off-by: Joey Hess <joey@kitenet.net>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
gitweb/gitweb.perl

index 90cd99bf916135e5c0a9e1bd7d5e9ff45555c489..269f1125d9442cb4e0eaecb9069af1d32b4d947b 100755 (executable)
@@ -2092,7 +2092,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