1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-30 11:26:29 +02:00

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>
This commit is contained in:
David Aguilar 2013-02-15 21:47:43 -08:00 committed by Junio C Hamano
parent 7b6e784d70
commit af14b5cf1b

View File

@ -336,7 +336,7 @@ sub main
}
if ($opts{gui}) {
my $guitool = Git::config('diff.guitool');
if (length($guitool) > 0) {
if (defined($guitool) && length($guitool) > 0) {
$ENV{GIT_DIFF_TOOL} = $guitool;
}
}