summaryrefslogtreecommitdiff
path: root/git-difftool.perl
diff options
context:
space:
mode:
authorDavid Aguilar <davvid@gmail.com>2013-02-15 21:47:43 -0800
committerJunio C Hamano <gitster@pobox.com>2013-02-17 14:34:38 -0800
commitaf14b5cf1bec831f90fb5d4136e0205de802b01b (patch)
treecb6026d2394ef403d922a720c2c76e4b5639e127 /git-difftool.perl
parent7b6e784d70142a23b8ee031b9190e30b9d4d6845 (diff)
downloadgit-af14b5cf1bec831f90fb5d4136e0205de802b01b.tar.gz
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>
Diffstat (limited to 'git-difftool.perl')
-rwxr-xr-xgit-difftool.perl2
1 files changed, 1 insertions, 1 deletions
diff --git a/git-difftool.perl b/git-difftool.perl
index 0a90de4146..12231fbc67 100755
--- a/git-difftool.perl
+++ b/git-difftool.perl
@@ -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;
}
}