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>maint
parent
7b6e784d70
commit
af14b5cf1b
|
@ -336,7 +336,7 @@ sub main
|
||||||
}
|
}
|
||||||
if ($opts{gui}) {
|
if ($opts{gui}) {
|
||||||
my $guitool = Git::config('diff.guitool');
|
my $guitool = Git::config('diff.guitool');
|
||||||
if (length($guitool) > 0) {
|
if (defined($guitool) && length($guitool) > 0) {
|
||||||
$ENV{GIT_DIFF_TOOL} = $guitool;
|
$ENV{GIT_DIFF_TOOL} = $guitool;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue