difftool: silence uninitialized variable warning
Git::config() returns `undef` when given keys that do not exist. Check that the $guitool value is defined to prevent a noisy "Use of uninitialized variable $guitool in length" warning. Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
David Aguilar committed
Feb 15, 2013 at 21:47 UTC
af14b5cf1bec831f90fb5d4136e0205de802b01b
1 file changed
+1
-1
git-difftool.perl
+1
-1
@@ -336,7 +336,7 @@ sub main
336
}
337
if ($opts{gui}) {
338
my $guitool = Git::config('diff.guitool');
339
- if (length($guitool) > 0) {
339
+ if (defined($guitool) && length($guitool) > 0) {
340
$ENV{GIT_DIFF_TOOL} = $guitool;
341
}
342
}