From 5c72da9e7a22dd36d3b231e4ab72578fa7c44860 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Sun, 8 Mar 2015 07:18:01 +0100 Subject: [PATCH] index: silence git read warning > Value of construct can be "0"; test with defined() Introduced in v1.6-29-gb733f67373 (2015-02-13) [index: latest git commit]. --- index.plp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.plp b/index.plp index 53cec89..1bb2d7b 100644 --- a/index.plp +++ b/index.plp @@ -25,7 +25,8 @@ but you're free to use, print, alter, and redistribute under the AGPL license. <: my @format = ('--date=short', "--pretty=%ad (%ar)\t%s"); if (open my $log, '-|', git => 'log', -1, @format) {{ - my $line = readline $log or next; + my $line = readline $log; + $line or next; # explicitly ignore empty input my ($date, $subject) = split /[\t\n]/, $line; $date =~ s/ \K// and $date .= ''; print "

Last update: $date $subject

\n"; -- 2.30.0